summaryrefslogtreecommitdiffstats
path: root/mcp/scripts/salt.sh
diff options
context:
space:
mode:
authorMichael Polenchuk <mpolenchuk@mirantis.com>2017-11-28 08:26:49 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-11-28 08:26:49 +0000
commit0cd4332f168052af8887d794b16efa7ba661d509 (patch)
tree59f4ee6144d789eb7203ae62f63dab52602c30be /mcp/scripts/salt.sh
parent255742b98efd4ff499a6abc6eb491059fc268d43 (diff)
parent6ead32f737f39e3d82e1484a9d31f07ed2daeadb (diff)
Merge "Add pre-{install,purge} support for base image"
Diffstat (limited to 'mcp/scripts/salt.sh')
-rwxr-xr-xmcp/scripts/salt.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/mcp/scripts/salt.sh b/mcp/scripts/salt.sh
index ab096f3ee..b719aa8ae 100755
--- a/mcp/scripts/salt.sh
+++ b/mcp/scripts/salt.sh
@@ -18,6 +18,8 @@ OPNFV_TMP_DIR="/home/${SALT_MASTER_USER}/opnfv"
OPNFV_GIT_DIR="/root/opnfv"
OPNFV_FUEL_DIR="/root/fuel"
OPNFV_RDIR="reclass/classes/cluster/all-mcp-ocata-common"
+OPNFV_VCP_IMG="mcp/scripts/base_image_opnfv_fuel_vcp.img"
+OPNFV_VCP_DIR="/srv/salt/env/prd/salt/files/control/images"
LOCAL_GIT_DIR="${F_GIT_ROOT%${F_GIT_SUBD}}"
LOCAL_PDF_RECLASS=$1
NODE_MASK='*'
@@ -34,6 +36,11 @@ if [ -n "${LOCAL_PDF_RECLASS}" ] && [ -f "${LOCAL_PDF_RECLASS}" ]; then
rsync -e "ssh ${SSH_OPTS}" "${LOCAL_PDF_RECLASS}" \
"${remote_tmp}${F_GIT_SUBD}/mcp/${OPNFV_RDIR}/opnfv/"
fi
+local_vcp_img=$(dirname "${LOCAL_PDF_RECLASS}")/$(basename "${OPNFV_VCP_IMG}")
+if [ -e "${local_vcp_img}" ]; then
+ rsync -L -e "ssh ${SSH_OPTS}" "${local_vcp_img}" \
+ "${remote_tmp}${F_GIT_SUBD}/${OPNFV_VCP_IMG}"
+fi
# ssh to cfg01
# shellcheck disable=SC2086,2087
@@ -95,4 +102,9 @@ ssh ${SSH_OPTS} "${SSH_SALT}" bash -s -e << SALT_INSTALL_END
salt -C "${NODE_MASK} and not cfg01*" pkg.upgrade refresh=False
salt -C "${NODE_MASK} or cfg01*" state.sls ntp
+
+ if [ -f "${OPNFV_FUEL_DIR}/${OPNFV_VCP_IMG}" ]; then
+ mkdir -p "${OPNFV_VCP_DIR}"
+ mv "${OPNFV_FUEL_DIR}/${OPNFV_VCP_IMG}" "${OPNFV_VCP_DIR}/"
+ fi
SALT_INSTALL_END