From 6ead32f737f39e3d82e1484a9d31f07ed2daeadb Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Fri, 24 Nov 2017 20:28:01 +0100 Subject: Add pre-{install,purge} support for base image Extend and its invocation from with support for modifying foundation node VMs base image prior to using it with: - additional APT GPG keys; - additional APT repos; - packages to pre-install; - packages to pre-remove; - (non-configurable) cloud init datasource via NoCloud only, so VCP VMs won't wait for metadata service; While at it, re-use the resulting image as a base for another round of pre-patching (same operations as above are supported) to provide a base image for VCP VMs. Add AArch64-specific configuration based on new mechanisms: - pre-install linux-image-generic-hwe-16.04-edge (and headers) for foundation node and VCP (common) image (also requires new repo and its key); - pre-install cloud-init for VCP image (it should already be installed, but script needs non-empty config for VCP to create the VCP image and transfer it over to Salt Master); NOTE: cloud-init is required on VCP VMs for DHCP on 1st iface. JIRA: FUEL-309 Change-Id: I7dcaf0ffd9c57009133c6d339496ec831ab14375 Signed-off-by: Alexandru Avadanii --- mcp/scripts/salt.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mcp/scripts/salt.sh') 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 -- cgit 1.2.3-korg