From abf3a9401b29cfe905d3dd139d5c9e877f67c605 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Tue, 11 Jan 2022 18:31:35 -0500 Subject: [PATCH] listen instead to not start service if not running then restart if changes to files --- salt/salt/minion.sls | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/salt/salt/minion.sls b/salt/salt/minion.sls index d8bebf0b5..a9320defb 100644 --- a/salt/salt/minion.sls +++ b/salt/salt/minion.sls @@ -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 _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: