diff options
author | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2017-11-24 20:28:01 +0100 |
---|---|---|
committer | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2017-11-27 17:31:26 +0100 |
commit | 6ead32f737f39e3d82e1484a9d31f07ed2daeadb (patch) | |
tree | 5dff7d4cb14801651a1f69f664931262a6f6bdeb /ci | |
parent | 74a5bd6ae60916c664b0ec902418e3fae234b0c1 (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>
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/deploy.sh | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/ci/deploy.sh b/ci/deploy.sh index b13e18e7e..427850fda 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 @@ -413,7 +431,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 |