From 090f3a3e0211241b23ddc44be39a5bd7262974e5 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Tue, 19 Dec 2023 12:08:17 -0500 Subject: [PATCH] only run if in file --- salt/salt/minion.sls | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/salt/salt/minion.sls b/salt/salt/minion.sls index 83de89164..252ab9bec 100644 --- a/salt/salt/minion.sls +++ b/salt/salt/minion.sls @@ -67,10 +67,14 @@ set_log_levels: - "log_level: info" - "log_level_logfile: info" +# we use the only if here because there is a point in setup where thise state runs +# but this state isn'r present on a manager type node enable_startup_states: file.uncomment: - name: /etc/salt/minion - regex: '^startup_states: highstate$' + - onlyif: + - cmd: "grep 'startup_states: highstate' /etc/salt/minion" # prior to 2.4.30 this managed file would restart the salt-minion service when updated # since this file is currently only adding a sleep timer on service start