Ver código fonte

Fix minion install pkgs and dependency packages

pull/58/head
Petr Michalec 7 anos atrás
pai
commit
b4b7893e50
3 arquivos alterados com 27 adições e 0 exclusões
  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 Ver arquivo

@@ -95,9 +95,15 @@ Arch:
Debian:
pkgs:
- salt-minion
dependency_pkgs:
- python-m2crypto
- python-psutil
- python-yaml
- python-msgpack
dependency_pkgs_pip:
- PyYAML
- M2Crypto
- psutil
cert_pkgs:
- ca-certificates
Gentoo:
@@ -109,9 +115,14 @@ MacOS:
RedHat:
pkgs:
- salt-minion
dependency_pkgs:
- m2crypto
- psutils
- PyYAML
dependency_pkgs_pip:
- PyYAML
- M2Crypto
- psutil
cert_pkgs:
- ca-certificates
{%- endload %}

+ 2
- 0
salt/minion/grains.sls Ver arquivo

@@ -40,6 +40,8 @@ salt_minion_grain_{{ service_name }}_{{ name }}:
salt_minion_grain_{{ service_name }}_{{ name }}_validity_check:
cmd.wait:
- 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:
- file: salt_minion_grain_{{ service_name }}_{{ name }}
- watch_in:

+ 14
- 0
salt/minion/service.sls Ver arquivo

@@ -10,12 +10,20 @@ salt_minion_packages:
- version: {{ minion.source.version }}
{%- endif %}

salt_minion_dependency_packages:
pkg.installed:
- pkgs: {{ minion.dependency_pkgs }}

{%- elif minion.source.get('engine', 'pkg') == 'pip' %}

salt_minion_packages:
pip.installed:
- name: salt{% if minion.source.version is defined %}=={{ minion.source.version }}{% endif %}

salt_minion_dependency_packages:
pkg.installed:
- pkgs: {{ minion.dependency_pkgs_pip }}

{%- endif %}

/etc/salt/minion.d/minion.conf:
@@ -57,6 +65,9 @@ salt_minion_service:
service.running:
- name: {{ minion.service }}
- enable: true
- require:
- pkg: salt_minion_packages
- pkg: salt_minion_dependency_packages
{%- if grains.get('noservices') %}
- onlyif: /bin/false
{%- endif %}
@@ -81,5 +92,8 @@ salt_minion_sync_all:
- name: 'saltutil.sync_all'
- onchanges:
- service: salt_minion_service
- require:
- pkg: salt_minion_packages
- pkg: salt_minion_dependency_packages

{%- endif %}

Carregando…
Cancelar
Salvar