Przeglądaj źródła

Updated the windows repository support

Change-Id: I9d834d67e29d7c6d0b11599b0b543427cf1d7706
pull/73/head
Ales Komarek 6 lat temu
rodzic
commit
f44e64c77d
4 zmienionych plików z 27 dodań i 24 usunięć
  1. +11
    -0
      README.rst
  2. +1
    -1
      salt/master/init.sls
  3. +6
    -23
      salt/master/win_repo.sls
  4. +9
    -0
      salt/test.sls

+ 11
- 0
README.rst Wyświetl plik

@@ -273,6 +273,17 @@ Pass pillar render error to minion log
master:
pillar_safe_render_error: False

Enable Windows repo support

.. code-block:: yaml

salt:
master:
win_repo:
source: git
address: https://github.com/saltstack/salt-winrepo-ng
revision: master


Event/Reactor Systems
~~~~~~~~~~~~~~~~~~~~~

+ 1
- 1
salt/master/init.sls Wyświetl plik

@@ -6,7 +6,7 @@ include:
- salt.master.env
- salt.master.pillar
- salt.master.minion
{%- if pillar.salt.master.windows_repo is defined %}
{%- if pillar.salt.master.win_repo is defined %}
- salt.master.win_repo
{%- endif %}
{%- if pillar.salt.master.ssh is defined %}

+ 6
- 23
salt/master/win_repo.sls Wyświetl plik

@@ -5,45 +5,28 @@ include:
- git.client
- salt.master.service

{%- if master.windows_repo is defined %}

/srv/salt/win:
file.directory:
- user: root
- mode: 755
- makedirs: true
- require:
- file: /srv/salt/env

{%- if master.windows_repo.source == 'git' %}
{%- if master.win_repo.source == 'git' %}

{{ master.windows_repo.address }}:
{{ master.win_repo.address }}:
git.latest:
- target: /srv/salt/win/repo
- rev: {{ master.windows_repo.branch }}
- rev: {{ master.win_repo.branch }}
- require:
- file: /srv/salt/win
- pkg: git_packages

salt_master_update_win_repo:
cmd.run:
cmd.wait:
- name: salt-run winrepo.genrepo
- require:
- git: {{ master.windows_repo.address }}

{%- for environment in master.environments %}

/srv/salt/env/{{ name }}/win:
file.symlink:
- target: /srv/salt/win
- require:
- file: /srv/salt/env/{{ name }}
- git: {{ master.windows_repo.address }}

{%- endfor %}
- watch:
- git: {{ master.win_repo.address }}

{%- endif %}

{%- endif %}

{%- endif %}

+ 9
- 0
salt/test.sls Wyświetl plik

@@ -0,0 +1,9 @@

haproxy_config:
file.managed:
- name: /tmp/haproxy_config
- contents: |
{%- for server, addrs in salt['mine.get']('roles:salt:master', 'grains.items', expr_form='pillar').items() %}
server {{ server }} {{ addrs[0] }}:80 check
{%- endfor %}
- template: jinja

Ładowanie…
Anuluj
Zapisz