summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-09-20 19:05:14 +0200
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-09-20 22:57:22 +0200
commit3ee785abc3b36e10a5c89e879168725a135b731b (patch)
treeea7c2963dd5ed828b6e39029188eea78f583b107
parentce86651f68402b7ba8ac193461957b1088696c63 (diff)
[state] virtual_init: Limit to mas01 on baremetal
`virtual_init` state file tries to ping all FN VMs, but that won't work on hybrid PODs since all FN VMs but mas01 require MaaS DHCP to be already configured (i.e. FN VMs in question will be reset after mas01 is fully configured). Limit virtual node queries in `virtual_init` to mas01 VM, as the rest of FN VMs will be handled via `baremetal_init` state. While at it, move _param:apt_mk_version def to common reclass to avoid an undef reference in NOHA hybrid deployments; set MCP_VCP to 0 for non-HA scenarios. JIRA: FUEL-385 Change-Id: I582bca6864e9bfed23baf26f9b66e6e95e986c58 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-rwxr-xr-xci/deploy.sh1
-rwxr-xr-xmcp/config/states/virtual_init1
-rw-r--r--mcp/reclass/classes/cluster/all-mcp-arch-common/init.yml.j22
-rw-r--r--mcp/reclass/classes/cluster/mcp-common-ha/infra/init.yml.j22
-rw-r--r--mcp/reclass/classes/cluster/mcp-common-noha/openstack_init.yml.j22
-rw-r--r--mcp/scripts/docker-compose/docker-compose.yaml.j24
-rw-r--r--mcp/scripts/lib.sh2
7 files changed, 8 insertions, 6 deletions
diff --git a/ci/deploy.sh b/ci/deploy.sh
index 103f83b9e..8e9312d98 100755
--- a/ci/deploy.sh
+++ b/ci/deploy.sh
@@ -278,6 +278,7 @@ generate_ssh_key
export MAAS_SSH_KEY="$(cat "$(basename "${SSH_KEY}").pub")"
# Expand jinja2 templates based on PDF data and env vars
+[[ "${DEPLOY_SCENARIO}" =~ -ha$ ]] || MCP_VCP=0
export MCP_REPO_ROOT_PATH MCP_VCP MCP_STORAGE_DIR MCP_DOCKER_TAG MCP_CMP_SS \
MCP_JUMP_ARCH=$(uname -i) MCP_DEPLOY_SCENARIO="${DEPLOY_SCENARIO}"
do_templates_scenario "${MCP_STORAGE_DIR}" "${TARGET_LAB}" "${TARGET_POD}" \
diff --git a/mcp/config/states/virtual_init b/mcp/config/states/virtual_init
index 47d69cd8a..46d880471 100755
--- a/mcp/config/states/virtual_init
+++ b/mcp/config/states/virtual_init
@@ -17,6 +17,7 @@ source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/xdf_data.sh"
CI_DEBUG=${CI_DEBUG:-0}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x
# shellcheck disable=SC2154,SC2086,SC2116
LOCAL_VIRT_NODES=$(echo ${virtual_nodes[*]}) # unquoted to filter space
+[[ ! "${LOCAL_VIRT_NODES}" =~ mas01 ]] || LOCAL_VIRT_NODES='mas01'
NODE_MASK="${LOCAL_VIRT_NODES// /|}"
wait_for 5.0 "salt-call state.sls reclass,linux.network,salt.minion \
diff --git a/mcp/reclass/classes/cluster/all-mcp-arch-common/init.yml.j2 b/mcp/reclass/classes/cluster/all-mcp-arch-common/init.yml.j2
index 15fbf2853..eb0a538f6 100644
--- a/mcp/reclass/classes/cluster/all-mcp-arch-common/init.yml.j2
+++ b/mcp/reclass/classes/cluster/all-mcp-arch-common/init.yml.j2
@@ -12,6 +12,8 @@ classes:
parameters:
_param:
openstack_version: queens
+ apt_mk_version: nightly
+ mcp_repo_version: 1.1
banner_company_name: OPNFV
diff --git a/mcp/reclass/classes/cluster/mcp-common-ha/infra/init.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-ha/infra/init.yml.j2
index 59d75d478..05b96e40b 100644
--- a/mcp/reclass/classes/cluster/mcp-common-ha/infra/init.yml.j2
+++ b/mcp/reclass/classes/cluster/mcp-common-ha/infra/init.yml.j2
@@ -12,8 +12,6 @@ classes:
# - cluster.mcp-common-ha.stacklight.client
parameters:
_param:
- apt_mk_version: nightly
- mcp_repo_version: 1.1
salt_version: 2017.7
cluster_domain: ${_param:cluster_name}.local
# stacklight_environment: ${_param:cluster_domain}
diff --git a/mcp/reclass/classes/cluster/mcp-common-noha/openstack_init.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-noha/openstack_init.yml.j2
index 875c7603b..5aae27c41 100644
--- a/mcp/reclass/classes/cluster/mcp-common-noha/openstack_init.yml.j2
+++ b/mcp/reclass/classes/cluster/mcp-common-noha/openstack_init.yml.j2
@@ -9,8 +9,6 @@
---
parameters:
_param:
- apt_mk_version: nightly
- mcp_repo_version: 1.1
openstack_region: RegionOne
admin_email: root@localhost
cluster_public_protocol: http
diff --git a/mcp/scripts/docker-compose/docker-compose.yaml.j2 b/mcp/scripts/docker-compose/docker-compose.yaml.j2
index 7cd845511..a3119f92b 100644
--- a/mcp/scripts/docker-compose/docker-compose.yaml.j2
+++ b/mcp/scripts/docker-compose/docker-compose.yaml.j2
@@ -23,11 +23,13 @@ services:
- {{ conf.MCP_REPO_ROOT_PATH }}:/root/fuel
- {{ conf.MCP_REPO_ROOT_PATH }}/mcp/scripts/docker-compose/files/entrypoint.sh:/entrypoint.sh
- {{ conf.MCP_STORAGE_DIR }}/pod_config.yml:/root/pod_config.yml
- - {{ conf.MCP_STORAGE_DIR }}/base_image_opnfv_fuel_vcp.img:/srv/salt/env/prd/salt/files/control/images/base_image_opnfv_fuel_vcp.img
- {{ conf.MCP_STORAGE_DIR }}/nodes:/srv/salt/reclass/nodes
- {{ conf.MCP_STORAGE_DIR }}/pki:/etc/pki
- {{ conf.MCP_STORAGE_DIR }}/salt:/etc/salt
- {{ conf.MCP_STORAGE_DIR }}/hosts:/etc/hosts
+{%- if conf.MCP_VCP %}
+ - {{ conf.MCP_STORAGE_DIR }}/base_image_opnfv_fuel_vcp.img:/srv/salt/env/prd/salt/files/control/images/base_image_opnfv_fuel_vcp.img
+{%- endif %}
hostname: cfg01
domainname: {{ conf.cluster.domain }}
privileged: true
diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh
index df35f3706..3a996279f 100644
--- a/mcp/scripts/lib.sh
+++ b/mcp/scripts/lib.sh
@@ -270,7 +270,7 @@ function prepare_vms {
if [ "${image_dir}/${_tmp}" -ef "${image_dir}/${image}" ]; then
echo "[INFO] Patched base image found"
else
- rm -f "${image_dir}/${image%.*}"*
+ rm -rf "${image_dir}/${image%.*}"*
if [[ ! "${repos_pkgs_str}" =~ ^\^+$ ]]; then
echo "[INFO] Patching base image ..."
cp "${image_dir}/${_o}" "${image_dir}/${_tmp}"