aboutsummaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-11-24 20:28:01 +0100
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-01-04 00:05:45 +0100
commit4c32ab7cd0c86254019542fea65b6130248ea2e6 (patch)
treeb5d5d1e02e313015caeeb20f99e557da839f704a /ci
parent81f3c7a84d84c4f936a81d588f819d342c01e1f1 (diff)
Add pre-{install,purge} support for base image
Extend <lib.sh> and its invocation from <ci.deploy.sh> 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 <Alexandru.Avadanii@enea.com> (cherry picked from commit 6ead32f737f39e3d82e1484a9d31f07ed2daeadb)
Diffstat (limited to 'ci')
-rwxr-xr-xci/deploy.sh23
1 files changed, 21 insertions, 2 deletions
diff --git a/ci/deploy.sh b/ci/deploy.sh
index fd3911d08..f62a0574b 100755
--- a/ci/deploy.sh
+++ b/ci/deploy.sh
@@ -15,6 +15,7 @@
do_exit () {
local RC=$?
clean
+ cleanup_mounts
if [ ${RC} -eq 0 ]; then
notify "\n[OK] MCP: Openstack installation finished succesfully!\n\n" 2
else
@@ -158,6 +159,7 @@ NO_DEPLOY_ENVIRONMENT=${NO_DEPLOY_ENVIRONMENT:-0}
ERASE_ENV=${ERASE_ENV:-0}
source "${DEPLOY_DIR}/globals.sh"
+source "${DEPLOY_DIR}/lib.sh"
#
# END of variables to customize
@@ -340,7 +342,6 @@ fi
# Get required infra deployment data
set +x
-source lib.sh
eval "$(parse_yaml "${SCENARIO_DIR}/defaults-$(uname -i).yaml")"
eval "$(parse_yaml "${SCENARIO_DIR}/${DEPLOY_TYPE}/${DEPLOY_SCENARIO}.yaml")"
eval "$(parse_yaml "${LOCAL_PDF_RECLASS}")"
@@ -358,6 +359,23 @@ for node in "${virtual_nodes[@]}"; do
done
virtual_nodes_data=${virtual_nodes_data%|}
+# Serialize repos, packages to (pre-)install/remove for:
+# - foundation node VM base image (virtual: all VMs, baremetal: cfg01|mas01)
+# - virtualized control plane VM base image (only when VCP is used)
+base_image_flavors=common
+if [[ "${cluster_states[*]}" =~ virtual_control ]]; then
+ base_image_flavors+=" control"
+fi
+for sc in ${base_image_flavors}; do
+ for va in apt_keys apt_repos pkg_install pkg_remove; do
+ key=virtual_${sc}_${va}
+ eval "${key}=\${${key}[@]// /|}"
+ eval "${key}=\${${key}// /,}"
+ virtual_repos_pkgs+="${!key}^"
+ done
+done
+virtual_repos_pkgs=${virtual_repos_pkgs%^}
+
# Expand reclass and virsh network templates
for tp in "${RECLASS_CLUSTER_DIR}/all-mcp-ocata-common/opnfv/"*.template \
net_*.template; do
@@ -411,7 +429,8 @@ elif [ ${USE_EXISTING_INFRA} -gt 0 ]; then
check_connection
else
generate_ssh_key
- prepare_vms "${base_image}" "${STORAGE_DIR}" "${virtual_nodes[@]}"
+ prepare_vms "${base_image}" "${STORAGE_DIR}" "${virtual_repos_pkgs}" \
+ "${virtual_nodes[@]}"
create_networks "${OPNFV_BRIDGES[@]}"
create_vms "${STORAGE_DIR}" "${virtual_nodes_data}" "${OPNFV_BRIDGES[@]}"
update_mcpcontrol_network