aboutsummaryrefslogtreecommitdiffstats
path: root/mcp/scripts/salt.sh
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-01-30 01:25:06 +0100
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-01-30 20:10:11 +0100
commite1325bf5c526f063e7e16326ad6bfdd1c44d5fec (patch)
treeaceda324fdde04653406ff0a69b4e0d23b10ccff /mcp/scripts/salt.sh
parent5532af2b423237474b7667250c81ada255426898 (diff)
[patch] Group APT calls for salt formula install
When installing salt-formula-* on cfg01, we used to call APT for each package. Instead, handle them all at once. While at it, stop using colored output on terminals that don't support it (e.g. 'vt220' used by OPNFV Jenkins). Change-Id: Ib8f2cee9638c43cdf648487bf05b07cd49802d3e Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'mcp/scripts/salt.sh')
-rwxr-xr-xmcp/scripts/salt.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/mcp/scripts/salt.sh b/mcp/scripts/salt.sh
index 547137afe..03218e27f 100755
--- a/mcp/scripts/salt.sh
+++ b/mcp/scripts/salt.sh
@@ -47,6 +47,7 @@ fi
ssh ${SSH_OPTS} "${SSH_SALT}" bash -s -e << SALT_INSTALL_END
sudo -i
set -e
+ export TERM=${TERM}
export CI_DEBUG=${CI_DEBUG}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x
echo -n 'Checking out cloud-init has finished running ...'
@@ -71,7 +72,7 @@ ssh ${SSH_OPTS} "${SSH_SALT}" bash -s -e << SALT_INSTALL_END
cd /srv/salt/scripts
export DEBIAN_FRONTEND=noninteractive
echo 'Dpkg::Use-Pty "0";' > /etc/apt/apt.conf.d/90silence-dpkg
- OLD_DOMAIN=\$(grep -Pzo "id: cfg01\.\K(\S*)" /etc/salt/minion.d/minion.conf) || true
+ OLD_DOMAIN=\$(grep -sPzo "id: cfg01\.\K(\S*)" /etc/salt/minion.d/minion.conf) || true
BOOTSTRAP_SALTSTACK_OPTS=" -r -dX stable 2016.11 " \
MASTER_HOSTNAME=cfg01.${CLUSTER_DOMAIN} DISTRIB_REVISION=stable \
EXTRA_FORMULAS="nfs" \
@@ -87,7 +88,7 @@ ssh ${SSH_OPTS} "${SSH_SALT}" bash -s -e << SALT_INSTALL_END
# In case scenario changed (and implicitly domain name), re-register minions
if [ -n "\${OLD_DOMAIN}" ] && [ "\${OLD_DOMAIN}" != "${CLUSTER_DOMAIN}" ]; then
- salt "*.\${OLD_DOMAIN}" cmd.run "grep \${OLD_DOMAIN} -Rl /etc/salt | \
+ salt "*.\${OLD_DOMAIN}" cmd.run "grep \${OLD_DOMAIN} -sRl /etc/salt | \
xargs --no-run-if-empty sed -i 's/\${OLD_DOMAIN}/${CLUSTER_DOMAIN}/g'; \
service salt-minion restart" || true
salt-key -yd "*.\${OLD_DOMAIN}"