瀏覽代碼

Merge pull request #58 from maxyko/pull/45

Fix minion install pkgs and dependency packages
pull/59/merge
Filip Pytloun 7 年之前
父節點
當前提交
74454f8eb3
共有 3 個文件被更改,包括 27 次插入0 次删除
  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 查看文件

@@ -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 查看文件

@@ -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 查看文件

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

Loading…
取消
儲存