aboutsummaryrefslogtreecommitdiffstats
path: root/mcp/scripts/salt.sh
diff options
context:
space:
mode:
Diffstat (limited to 'mcp/scripts/salt.sh')
-rwxr-xr-xmcp/scripts/salt.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/mcp/scripts/salt.sh b/mcp/scripts/salt.sh
index ac9d74f35..ef7d383cd 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 ...'
@@ -54,7 +55,7 @@ ssh ${SSH_OPTS} "${SSH_SALT}" bash -s -e << SALT_INSTALL_END
echo ' done'
mkdir -p /srv/salt /usr/share/salt-formulas/reclass
- rm -rf ${OPNFV_GIT_DIR}
+ rm -rf ${OPNFV_GIT_DIR} ${OPNFV_FUEL_DIR}
mv ${OPNFV_TMP_DIR} ${OPNFV_GIT_DIR} && chown -R root.root ${OPNFV_GIT_DIR}
find ${OPNFV_GIT_DIR} -name '.git' -type f | while read f_git; do
sed -i 's@${LOCAL_GIT_DIR}@${OPNFV_GIT_DIR}@g' \$f_git
@@ -70,7 +71,8 @@ ssh ${SSH_OPTS} "${SSH_SALT}" bash -s -e << SALT_INSTALL_END
cd /srv/salt/scripts
export DEBIAN_FRONTEND=noninteractive
- OLD_DOMAIN=\$(grep -Pzo "id: cfg01\.\K(\S*)" /etc/salt/minion.d/minion.conf) || true
+ echo 'Dpkg::Use-Pty "0";' > /etc/apt/apt.conf.d/90silence-dpkg
+ 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=2017.12 \
EXTRA_FORMULAS="nfs" \
@@ -86,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}"