Fix minion install pkgs and dependency packagespull/59/merge
Debian: | Debian: | ||||
pkgs: | pkgs: | ||||
- salt-minion | - salt-minion | ||||
dependency_pkgs: | |||||
- python-m2crypto | - python-m2crypto | ||||
- python-psutil | - python-psutil | ||||
- python-yaml | - python-yaml | ||||
- python-msgpack | |||||
dependency_pkgs_pip: | |||||
- PyYAML | |||||
- M2Crypto | |||||
- psutil | |||||
cert_pkgs: | cert_pkgs: | ||||
- ca-certificates | - ca-certificates | ||||
Gentoo: | Gentoo: | ||||
RedHat: | RedHat: | ||||
pkgs: | pkgs: | ||||
- salt-minion | - salt-minion | ||||
dependency_pkgs: | |||||
- m2crypto | - m2crypto | ||||
- psutils | - psutils | ||||
- PyYAML | - PyYAML | ||||
dependency_pkgs_pip: | |||||
- PyYAML | |||||
- M2Crypto | |||||
- psutil | |||||
cert_pkgs: | cert_pkgs: | ||||
- ca-certificates | - ca-certificates | ||||
{%- endload %} | {%- endload %} |
salt_minion_grain_{{ service_name }}_{{ name }}_validity_check: | salt_minion_grain_{{ service_name }}_{{ name }}_validity_check: | ||||
cmd.wait: | cmd.wait: | ||||
- name: python -c "import yaml; stream = file('/etc/salt/grains.d/{{ name }}', 'r'); yaml.load(stream); stream.close()" | - name: python -c "import yaml; stream = file('/etc/salt/grains.d/{{ name }}', 'r'); yaml.load(stream); stream.close()" | ||||
- require: | |||||
- pkg: salt_minion_dependency_packages | |||||
- watch: | - watch: | ||||
- file: salt_minion_grain_{{ service_name }}_{{ name }} | - file: salt_minion_grain_{{ service_name }}_{{ name }} | ||||
- watch_in: | - watch_in: |
- version: {{ minion.source.version }} | - version: {{ minion.source.version }} | ||||
{%- endif %} | {%- endif %} | ||||
salt_minion_dependency_packages: | |||||
pkg.installed: | |||||
- pkgs: {{ minion.dependency_pkgs }} | |||||
{%- elif minion.source.get('engine', 'pkg') == 'pip' %} | {%- elif minion.source.get('engine', 'pkg') == 'pip' %} | ||||
salt_minion_packages: | salt_minion_packages: | ||||
pip.installed: | pip.installed: | ||||
- name: salt{% if minion.source.version is defined %}=={{ minion.source.version }}{% endif %} | - name: salt{% if minion.source.version is defined %}=={{ minion.source.version }}{% endif %} | ||||
salt_minion_dependency_packages: | |||||
pkg.installed: | |||||
- pkgs: {{ minion.dependency_pkgs_pip }} | |||||
{%- endif %} | {%- endif %} | ||||
/etc/salt/minion.d/minion.conf: | /etc/salt/minion.d/minion.conf: | ||||
service.running: | service.running: | ||||
- name: {{ minion.service }} | - name: {{ minion.service }} | ||||
- enable: true | - enable: true | ||||
- require: | |||||
- pkg: salt_minion_packages | |||||
- pkg: salt_minion_dependency_packages | |||||
{%- if grains.get('noservices') %} | {%- if grains.get('noservices') %} | ||||
- onlyif: /bin/false | - onlyif: /bin/false | ||||
{%- endif %} | {%- endif %} | ||||
- name: 'saltutil.sync_all' | - name: 'saltutil.sync_all' | ||||
- onchanges: | - onchanges: | ||||
- service: salt_minion_service | - service: salt_minion_service | ||||
- require: | |||||
- pkg: salt_minion_packages | |||||
- pkg: salt_minion_dependency_packages | |||||
{%- endif %} | {%- endif %} |