From 4b11912d2dc915d642d82e6da0c94e185ec66c99 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Sun, 10 Sep 2017 23:33:36 +0200 Subject: reclass, states: Parametrize runtime configuration mcpcontrol virsh network, as well as MaaS PXE network are installer specific, and not POD specific. Therefore, these should be easily parametrized without the PDF, using only installer inputs (e.g. env vars passed via Jenkins). - add new reclass class; - parametrize at runtime new reclass class based on global vars; - factor out MaaS deploy address / config using new mechanism; - parametrize at runtime virsh network definitions based on template; - add new "maas.pxe_route" sls for configuring routing on cfg01; - replace env vars with the new sls in "maas" state; NOTE: baremetal parametrization will be handled later. Change-Id: Ifd61143d818fb088b3f4395388ba769bbc49156e Signed-off-by: Alexandru Avadanii --- ci/deploy.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ci') diff --git a/ci/deploy.sh b/ci/deploy.sh index 603d6e562..f6af1b57a 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -135,6 +135,7 @@ clean() { SCRIPT_PATH=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")") DEPLOY_DIR=$(cd "${SCRIPT_PATH}/../mcp/scripts"; pwd) STORAGE_DIR=$(cd "${SCRIPT_PATH}/../mcp/deploy/images"; pwd) +RECLASS_CLUSTER_DIR=$(cd "${SCRIPT_PATH}/../mcp/reclass/classes/cluster"; pwd) DEPLOY_TYPE='baremetal' OPNFV_BRIDGES=('pxebr' 'mgmt' 'internal' 'public') URI_REGEXP='(file|https?|ftp)://.*' @@ -143,6 +144,11 @@ export SSH_KEY=${SSH_KEY:-"/var/lib/opnfv/mcp.rsa"} export SALT_MASTER=${INSTALLER_IP:-10.20.0.2} export SALT_MASTER_USER=${SALT_MASTER_USER:-ubuntu} export MAAS_IP=${MAAS_IP:-${SALT_MASTER%.*}.3} +export MAAS_PXE_NETWORK=${MAAS_PXE_NETWORK:-192.168.11.0} + +# Derivated from above global vars +export MCP_CTRL_NETWORK_ROOTSTR=${SALT_MASTER%.*} +export MAAS_PXE_NETWORK_ROOTSTR=${MAAS_PXE_NETWORK%.*} export SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${SSH_KEY}" export SSH_SALT="${SALT_MASTER_USER}@${SALT_MASTER}" @@ -327,6 +333,10 @@ for node in "${virtual_nodes[@]}"; do virtual_nodes_vcpus[$node]=${!virtual_custom_vcpus:-$virtual_default_vcpus} done +# Expand reclass and virsh network templates +for tp in "${RECLASS_CLUSTER_DIR}/all-mcp-ocata-common/opnfv/"*.template \ + net_*.template; do envsubst < "${tp}" > "${tp%.template}"; done + # Infra setup generate_ssh_key prepare_vms virtual_nodes "${base_image}" "${STORAGE_DIR}" -- cgit 1.2.3-korg