listen instead to not start service if not running then restart if changes to files

This commit is contained in:
m0duspwnens
2022-01-11 18:31:35 -05:00
parent ae0f392035
commit abf3a9401b

View File

@@ -62,8 +62,6 @@ set_log_levels:
- text:
- "log_level: error"
- "log_level_logfile: error"
- listen_in:
- service: salt_minion_service
salt_minion_service_unit_file:
file.managed:
@@ -74,8 +72,6 @@ salt_minion_service_unit_file:
service_start_delay: {{ service_start_delay }}
- onchanges_in:
- module: systemd_reload
- listen_in:
- service: salt_minion_service
{% endif %}
@@ -84,8 +80,6 @@ mine_functions:
- name: /etc/salt/minion.d/mine_functions.conf
- source: salt://salt/etc/minion.d/mine_functions.conf
- template: jinja
- listen_in:
- service: salt_minion_service
# this has to be outside the if statement above since there are <requisite>_in calls to this state
salt_minion_service:
@@ -93,6 +87,13 @@ salt_minion_service:
- name: salt-minion
- enable: True
- onlyif: test "{{INSTALLEDSALTVERSION}}" == "{{SALTVERSION}}"
- listen:
- file: mine_functions
{% if INSTALLEDSALTVERSION|string == SALTVERSION|string %}
- file: set_log_levels
- file: salt_minion_service_unit_file
{% endif %}
patch_pkg:
pkg.installed: