summaryrefslogtreecommitdiffstats
path: root/mcp/config
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2019-02-19 15:17:25 +0000
committerGerrit Code Review <gerrit@opnfv.org>2019-02-19 15:17:25 +0000
commit3c34bab9279d5dbe7df3824131e4487e5017ef15 (patch)
tree2764cdfd7b9c8d597713d90b7958c6f4bbff8bf0 /mcp/config
parent1b2958b0695ebc9e2ba95f782b854540cea42c14 (diff)
parent58af9a94ef78bbcf3f0593d4170d32ebce721455 (diff)
Merge "[baremetal] Containerize MaaS"
Diffstat (limited to 'mcp/config')
-rw-r--r--mcp/config/scenario/defaults.yaml.j27
-rwxr-xr-xmcp/config/states/maas4
-rwxr-xr-xmcp/config/states/virtual_init13
3 files changed, 9 insertions, 15 deletions
diff --git a/mcp/config/scenario/defaults.yaml.j2 b/mcp/config/scenario/defaults.yaml.j2
index 73799c5bb..4c6a86f03 100644
--- a/mcp/config/scenario/defaults.yaml.j2
+++ b/mcp/config/scenario/defaults.yaml.j2
@@ -12,12 +12,6 @@ x86_64:
default:
vcpus: 2
ram: 4096
- virtual: &arch_default_virtual_nodes_infra
- nodes:
- infra:
-{%- if nm.cluster.has_baremetal_nodes %}
- - mas01
-{%- endif %}
cluster: &arch_default_cluster_states
states:
- virtual_init
@@ -49,7 +43,6 @@ aarch64:
default:
vcpus: 6
ram: 4096
- virtual: *arch_default_virtual_nodes_infra
cluster: *arch_default_cluster_states
common:
apt:
diff --git a/mcp/config/states/maas b/mcp/config/states/maas
index 47f66a451..28ef4cae0 100755
--- a/mcp/config/states/maas
+++ b/mcp/config/states/maas
@@ -17,6 +17,8 @@ source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/lib.sh"
bm_nodes=$(salt --out yaml 'mas01*' pillar.get maas:region:machines | \
awk '/^\s+\w+[[:digit:]]+:$/ {gsub(/:$/, "*"); printf "%s ", $1}')
+wait_for 60.0 "salt --out yaml -C 'mas01*' service.status maas-fixup | fgrep -q 'false'"
+
# Optionally destroy MaaS machines from a previous run
if [ "${ERASE_ENV}" -gt 1 ]; then
cleanup_uefi
@@ -26,7 +28,7 @@ if [ "${ERASE_ENV}" -gt 1 ]; then
fi
# MaaS rack/region controller, node commissioning
-wait_for 10.0 "salt -C 'mas01*' state.apply linux,salt,openssh,ntp,iptables"
+wait_for 10.0 "salt -C 'mas01*' state.apply salt,iptables"
salt -C 'mas01*' state.apply maas.cluster
wait_for 10 "salt -C 'mas01*' state.apply maas.region"
diff --git a/mcp/config/states/virtual_init b/mcp/config/states/virtual_init
index 46d880471..e8837571b 100755
--- a/mcp/config/states/virtual_init
+++ b/mcp/config/states/virtual_init
@@ -17,7 +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'
+[[ ! "${cluster_states[*]}" =~ maas ]] || LOCAL_VIRT_NODES='mas01'
NODE_MASK="${LOCAL_VIRT_NODES// /|}"
wait_for 5.0 "salt-call state.sls reclass,linux.network,salt.minion \
@@ -28,13 +28,12 @@ wait_for 3.0 "salt -C 'E@^(${NODE_MASK}).*' saltutil.refresh_pillar"
# Init specific to VMs on FN (all for virtual, mas for baremetal)
wait_for 3.0 "(for n in ${LOCAL_VIRT_NODES}; do salt -C \${n}.* test.ping || exit; done)"
+wait_for 3.0 "salt -C 'E@^(${NODE_MASK}).*' saltutil.sync_all"
+[[ ! "${NODE_MASK}" =~ mas01 ]] || exit 0
+
+wait_for 3.0 "salt -C 'E@^(${NODE_MASK}).*' state.sls linux"
-wait_for 3.0 "salt -C 'E@^(${NODE_MASK}).*' state.sls linux.system,linux.storage"
-wait_for 2.0 "salt -C 'E@^(${NODE_MASK}).*' state.sls linux.network"
salt -C "E@^(${NODE_MASK}).*" system.reboot
wait_for 90.0 "salt -C 'E@^(${NODE_MASK}).*' test.ping"
wait_for 3.0 "salt -C 'E@^(${NODE_MASK}).*' pkg.upgrade refresh=False dist_upgrade=True"
-wait_for 3.0 "salt -C 'E@^(${NODE_MASK}).*' saltutil.sync_all"
-wait_for 3.0 "salt -C 'E@^(${NODE_MASK}).*' state.apply salt"
-
-wait_for 3.0 "salt -C 'E@^(${NODE_MASK}).*' state.sls ntp"
+wait_for 3.0 "salt -C 'E@^(${NODE_MASK}).*' state.apply salt,ntp"