Browse Source

Merge pull request #58 from maxyko/pull/45

Fix minion install pkgs and dependency packages
pull/59/merge
Filip Pytloun 7 years ago
parent
commit
74454f8eb3
3 changed files with 27 additions and 0 deletions
  1. +11
    -0
      salt/map.jinja
  2. +2
    -0
      salt/minion/grains.sls
  3. +14
    -0
      salt/minion/service.sls

+ 11
- 0
salt/map.jinja View File

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 %}

+ 2
- 0
salt/minion/grains.sls View File

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:

+ 14
- 0
salt/minion/service.sls View File

- 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 %}

Loading…
Cancel
Save