From 22fbb953ea34bf038d8d426c1f59788bfe4bf75c Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Mon, 23 Jan 2023 14:46:26 -0500 Subject: [PATCH] create cronjob to run highstate after setup --- salt/common/init.sls | 5 +++++ salt/setup/highstate_cron.sls | 6 ++++++ setup/so-setup | 1 + 3 files changed, 12 insertions(+) create mode 100644 salt/setup/highstate_cron.sls diff --git a/salt/common/init.sls b/salt/common/init.sls index a03eaacde..ea943ce4b 100644 --- a/salt/common/init.sls +++ b/salt/common/init.sls @@ -218,6 +218,11 @@ sostatus_check_cron: - month: '*' - dayweek: '*' +remove_post_setup_cron: + cron.absent: + - name: 'salt-call state.highstate' + - identifier: post_setup_cron + {% if GLOBALS.role not in ['eval', 'manager', 'managersearch', 'standalone'] %} soversionfile: diff --git a/salt/setup/highstate_cron.sls b/salt/setup/highstate_cron.sls new file mode 100644 index 000000000..dcbab4d8d --- /dev/null +++ b/salt/setup/highstate_cron.sls @@ -0,0 +1,6 @@ +post_setup_cron: + cron.present: + - name: 'salt-call state.highstate' + - user: root + - minute: '*/1' + - identifier: post_setup_cron diff --git a/setup/so-setup b/setup/so-setup index 99e218a61..58573dcdd 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -608,6 +608,7 @@ if ! [[ -f $install_opt_file ]]; then configure_minion "$minion_type" drop_install_options checkin_at_boot + logCmd "salt-call state.apply setup.highstate_cron --local --file-root=../salt/" whiptail_setup_complete fi