From bc8659041166185d55f958fa808e63f1addf508b Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Tue, 22 Jun 2021 08:23:16 -0400 Subject: [PATCH 1/2] only add sosyncuser cron if startup_states: highstate is set in minion config --- salt/soc/init.sls | 3 +++ 1 file changed, 3 insertions(+) diff --git a/salt/soc/init.sls b/salt/soc/init.sls index 8e1943cb8..51751e9a6 100644 --- a/salt/soc/init.sls +++ b/salt/soc/init.sls @@ -62,10 +62,13 @@ soccustom: - mode: 600 - template: jinja +# we dont want this added to early in setup, so we add the onlyif to verify 'startup_states: highstate' +# is in the minion config. that is added before the final highstate during setup sosyncusers: cron.present: - user: root - name: 'PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin /usr/sbin/so-user sync &>> /opt/so/log/soc/sync.log' + - onlyif: "grep 'startup_states: highstate' /etc/salt/minion" so-soc: docker_container.running: From c3deabae36fe509ee306d0a45ba8bf219a48b0ec Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Tue, 22 Jun 2021 08:30:54 -0400 Subject: [PATCH 2/2] Update init.sls --- salt/soc/init.sls | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/soc/init.sls b/salt/soc/init.sls index 51751e9a6..b8cdb09ba 100644 --- a/salt/soc/init.sls +++ b/salt/soc/init.sls @@ -62,8 +62,8 @@ soccustom: - mode: 600 - template: jinja -# we dont want this added to early in setup, so we add the onlyif to verify 'startup_states: highstate' -# is in the minion config. that is added before the final highstate during setup +# we dont want this added too early in setup, so we add the onlyif to verify 'startup_states: highstate' +# is in the minion config. That line is added before the final highstate during setup sosyncusers: cron.present: - user: root