From 2e1d4c457395f162fe038243aabf30e851a04988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20B=C3=A9rtoli?= Date: Sun, 31 Mar 2019 13:02:13 -0300 Subject: [PATCH] Specify dependencies --- salt/master.sls | 7 ++++--- salt/minion.sls | 4 ++++ salt/pkgrepo/redhat/init.sls | 2 +- salt/syndic.sls | 4 ++++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/salt/master.sls b/salt/master.sls index 844e52c..d20c0b8 100644 --- a/salt/master.sls +++ b/salt/master.sls @@ -7,6 +7,10 @@ salt-master: {%- if salt_settings.version is defined %} - version: {{ salt_settings.version }} {%- endif %} + - require_in: + - service: salt-master + - watch_in: + - service: salt-master {% endif %} file.recurse: - name: {{ salt_settings.config_path }}/master.d @@ -18,9 +22,6 @@ salt-master: - enable: True - name: {{ salt_settings.master_service }} - watch: -{% if salt_settings.install_packages %} - - pkg: salt-master -{% endif %} - file: salt-master - file: remove-old-master-conf-file diff --git a/salt/minion.sls b/salt/minion.sls index 0de243a..6022fe9 100644 --- a/salt/minion.sls +++ b/salt/minion.sls @@ -31,12 +31,16 @@ salt-minion: {# use force == True as workaround #} - force: True - version_check: /opt/salt/bin/salt-minion --version=.*{{ salt_settings.version }}.* + - require_in: + - service: salt-minion {%- else %} pkg.installed: - name: {{ salt_settings.salt_minion }} {%- if salt_settings.version is defined %} - version: {{ salt_settings.version }} {%- endif %} + - require_in: + - service: salt-minion {%- endif %} {% endif %} file.recurse: diff --git a/salt/pkgrepo/redhat/init.sls b/salt/pkgrepo/redhat/init.sls index f1d733d..4badc5f 100644 --- a/salt/pkgrepo/redhat/init.sls +++ b/salt/pkgrepo/redhat/init.sls @@ -1,6 +1,6 @@ {% from "salt/map.jinja" import salt_settings with context %} -{%- if grains['os']|lower not in ('amazon', 'fedora', 'suse',) %} +{%- if grains['os']|lower not in ('amazon', 'fedora') %} saltstack-pkgrepo: pkgrepo.managed: - humanname: SaltStack repo for RHEL/CentOS $releasever diff --git a/salt/syndic.sls b/salt/syndic.sls index 379da52..64a86b0 100644 --- a/salt/syndic.sls +++ b/salt/syndic.sls @@ -10,6 +10,10 @@ salt-syndic: {%- if salt_settings.version is defined %} - version: {{ salt_settings.version }} {%- endif %} + - require_in: + - service: salt-syndic + - watch_in: + - service: salt-syndic {% endif %} service.running: - enable: True