From ccfdafea0ad81094bb7183e96185bbd632700701 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Thu, 4 Jan 2024 16:24:48 -0500 Subject: [PATCH 1/2] enable startup_states: highstate on managers during setup and not with salt --- salt/salt/minion.sls | 1 + setup/so-functions | 7 +++++++ setup/so-setup | 1 + 3 files changed, 9 insertions(+) diff --git a/salt/salt/minion.sls b/salt/salt/minion.sls index 83de89164..2cc032745 100644 --- a/salt/salt/minion.sls +++ b/salt/salt/minion.sls @@ -71,6 +71,7 @@ enable_startup_states: file.uncomment: - name: /etc/salt/minion - regex: '^startup_states: highstate$' + - unless: pgrep so-setup # 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 diff --git a/setup/so-functions b/setup/so-functions index 8482b2e71..e6fd36044 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -543,6 +543,13 @@ configure_minion() { } >> "$setup_log" 2>&1 } +checkin_at_boot() { + local minion_config=/etc/salt/minion + + info "Enabling checkin at boot" + sed -i 's/#startup_states: highstate/startup_states: highstate/' "$minion_config" +} + check_requirements() { local req_mem local req_cores diff --git a/setup/so-setup b/setup/so-setup index 9d210f00c..ca1581ef9 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -781,6 +781,7 @@ if ! [[ -f $install_opt_file ]]; then title "Setting up Playbook" logCmd "so-playbook-reset" fi + checkin_at_boot set_initial_firewall_access logCmd "salt-call schedule.enable -linfo --local" verify_setup From b0447a9af5bcfd1a50af1385b6fc0f57fc3d108e Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Fri, 5 Jan 2024 09:28:04 -0500 Subject: [PATCH 2/2] Update so-raid-status for SM based appliances --- salt/common/tools/sbin_jinja/so-raid-status | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/salt/common/tools/sbin_jinja/so-raid-status b/salt/common/tools/sbin_jinja/so-raid-status index 0249f4ccd..6cd8b84de 100755 --- a/salt/common/tools/sbin_jinja/so-raid-status +++ b/salt/common/tools/sbin_jinja/so-raid-status @@ -49,11 +49,18 @@ check_nsm_raid() { check_boss_raid() { MVCLI=$(/usr/local/bin/mvcli info -o vd |grep status |grep functional) + MVTEST=$(/usr/local/bin/mvcli info -o vd | grep "No adapter") - if [[ -n $MVCLI ]]; then - BOSSRAID=0 + # Check to see if this is a SM based system + if [[ -z $MVTEST ]]; then + if [[ -n $MVCLI ]]; then + BOSSRAID=0 + else + BOSSRAID=1 + fi else - BOSSRAID=1 + # This doesn't have boss raid so lets make it 0 + BOSSRAID=0 fi } @@ -90,4 +97,4 @@ else RAIDSTATUS=1 fi -echo "nsmraid=$RAIDSTATUS" > /opt/so/log/raid/status.log \ No newline at end of file +echo "nsmraid=$RAIDSTATUS" > /opt/so/log/raid/status.log