From e1325bf5c526f063e7e16326ad6bfdd1c44d5fec Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Tue, 30 Jan 2018 01:25:06 +0100 Subject: [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 --- mcp/scripts/salt.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mcp/scripts') 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}" -- cgit 1.2.3-korg