From 4689e32ce48bf64589da12d86ad56866276a84f2 Mon Sep 17 00:00:00 2001 From: William Wernert Date: Fri, 19 Feb 2021 10:18:06 -0500 Subject: [PATCH] Add sed for curly braces in minion pillars to soup --- salt/common/tools/sbin/soup | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/salt/common/tools/sbin/soup b/salt/common/tools/sbin/soup index 09be9531c..0c322742d 100755 --- a/salt/common/tools/sbin/soup +++ b/salt/common/tools/sbin/soup @@ -205,7 +205,8 @@ pillar_changes() { [[ "$INSTALLEDVERSION" =~ rc.1 ]] && rc1_to_rc2 [[ "$INSTALLEDVERSION" =~ rc.2 ]] && rc2_to_rc3 [[ "$INSTALLEDVERSION" =~ rc.3 ]] && rc3_to_2.3.0 - [[ "$INSTALLEDVERSION" == 2.3.0 ]] || [[ "$INSTALLEDVERSION" == 2.3.1 ]] || [[ "$INSTALLEDVERSION" == 2.3.2 ]] || [[ "$INSTALLEDVERSION" == 2.3.10 ]] && 2.3.0_to_2.3.20 + [[ "$INSTALLEDVERSION" == 2.3.0 || "$INSTALLEDVERSION" == 2.3.1 || "$INSTALLEDVERSION" == 2.3.2 || "$INSTALLEDVERSION" == 2.3.10 ]] && fun_2.3.0_to_2.3.20 + [[ "$INSTALLEDVERSION" == 2.3.20 || "$INSTALLEDVERSION" == 2.3.21 ]] && fun_2.3.20_to_2.3.30 } rc1_to_rc2() { @@ -291,7 +292,7 @@ rc3_to_2.3.0() { INSTALLEDVERSION=2.3.0 } -2.3.0_to_2.3.20(){ +fun_2.3.0_to_2.3.20(){ DOCKERSTUFFBIP=$(echo $DOCKERSTUFF | awk -F'.' '{print $1,$2,$3,1}' OFS='.')/24 # Remove PCAP from global sed '/pcap:/d' /opt/so/saltstack/local/pillar/global.sls @@ -330,6 +331,14 @@ rc3_to_2.3.0() { } +fun_2.3.20_to_2.3.30() { + # Replace any curly brace scalars with the same scalar in single quotes + readarray -t minion_pillars <<< "$(find /opt/so/saltstack/local/minions -type f -name '*.sls')" + for pillar in "${minion_pillars[@]}"; do + sed -i -r "s/ (\{\{.*}})$/ '\1'/g" "$pillar" + done +} + space_check() { # Check to see if there is enough space CURRENTSPACE=$(df -BG / | grep -v Avail | awk '{print $4}' | sed 's/.$//')