diff options
Diffstat (limited to 'mcp/scripts')
-rw-r--r-- | mcp/scripts/lib.sh | 18 | ||||
m--------- | mcp/scripts/pharos | 0 | ||||
-rwxr-xr-x | mcp/scripts/salt.sh | 8 |
3 files changed, 22 insertions, 4 deletions
diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh index 29c27d9e9..d91dcc3e1 100644 --- a/mcp/scripts/lib.sh +++ b/mcp/scripts/lib.sh @@ -32,7 +32,7 @@ function get_base_image { local image_dir=$2 mkdir -p "${image_dir}" - wget -P "${image_dir}" -N "${base_image}" + wget --progress=dot:giga -P "${image_dir}" -N "${base_image}" } function __kernel_modules { @@ -456,3 +456,19 @@ function wait_for { return 1 ) } + +function do_sysctl_cfg { + local _conf='/etc/sysctl.d/99-opnfv-fuel-bridge.conf' + # https://wiki.libvirt.org/page/Net.bridge.bridge-nf-call_and_sysctl.conf + echo 'net.bridge.bridge-nf-call-arptables = 0' |& sudo tee "${_conf}" + echo 'net.bridge.bridge-nf-call-iptables = 0' |& sudo tee -a "${_conf}" + echo 'net.bridge.bridge-nf-call-ip6tables = 0' |& sudo tee -a "${_conf}" + sudo sysctl -q -p "${_conf}" +} + +function get_nova_compute_pillar_data { + local value=$(salt -C 'I@nova:compute and *01*' pillar.get _param:"${1}" --out yaml | cut -d ' ' -f2) + if [ "${value}" != "''" ]; then + echo ${value} + fi +} diff --git a/mcp/scripts/pharos b/mcp/scripts/pharos -Subproject 89d7cb905bf6f286648638f5865884ac5e332e5 +Subproject 77b600ef0d64210c1b5fd72581cfe7752fa00c8 diff --git a/mcp/scripts/salt.sh b/mcp/scripts/salt.sh index a13194363..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 ...' @@ -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=stable \ 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}" |