[maas] Adjust deployment order/timeouts 01/49801/1
authorMichael Polenchuk <mpolenchuk@mirantis.com>
Wed, 20 Dec 2017 12:27:58 +0000 (16:27 +0400)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Sun, 31 Dec 2017 00:18:01 +0000 (01:18 +0100)
Change-Id: I9dbb51ce2387450e4ae19f8b3444f5e52cfdc71d
Signed-off-by: Michael Polenchuk <mpolenchuk@mirantis.com>
(cherry-picked from commit 52bd5a8f6c5b27ec3070625a51aea8ff85f5a8db)

mcp/config/states/maas

index bf2de28..07718f8 100755 (executable)
@@ -19,7 +19,9 @@ function maas_fixup() {
   local statuscmd="salt 'mas01*' --out yaml state.apply maas.machines.status"
   local ncount=$(salt --out yaml 'mas01*' pillar.get maas:region:machines | \
     grep -cE '^\s{2}\w+:$')
-  wait_for 30 "${statuscmd} | tee /dev/stderr | " \
+
+  # wait_for has 10sec timeout * 96 = 16 min > 15min for Failed state
+  wait_for 96 "${statuscmd} | tee /dev/stderr | " \
     "grep -Eq '((Deployed|Ready): ${ncount}|status: (Failed|Allocated))'"
   local statusout=$(eval "${statuscmd}")
 
@@ -74,13 +76,15 @@ salt -C 'cfg01*' state.apply maas.pxe_route
 wait_for 10 "salt -C 'mas01*' state.apply maas.region"
 
 salt -C 'mas01*' state.apply maas.machines
-# MaaS node deployment
-wait_for 20 maas_fixup
 
 # cleanup outdated salt keys
+sleep 30
 salt-key --out yaml | awk '!/^(minions|- cfg01|- mas01)/ {print $2}' | \
   xargs -I{} salt-key -yd {}
 
+# MaaS node deployment
+wait_for 10 maas_fixup
+
 salt -C 'mas01*' pillar.item\
   maas:region:admin:username \
   maas:region:admin:password