baremetal: HA: Standalone openstack_ha state
[fuel.git] / mcp / config / states / maas
index 0c01617..fa5e446 100755 (executable)
@@ -29,6 +29,9 @@ salt -C 'mas01*' state.apply maas.machines
 wait_for "salt 'mas01*' --out yaml state.apply maas.machines.status | " \
          "tee /dev/stderr | fgrep -q 'Ready: 5'"
 
+# cleanup outdated salt keys
+salt-key --out yaml | awk '!/^(minions|- cfg01|- mas01)/ {print $2}' | xargs -I{} salt-key -yd {}
+
 # MaaS node deployment
 salt -C 'mas01*' state.apply maas.machines.deploy
 wait_for "salt 'mas01*' --out yaml state.apply maas.machines.status | " \
@@ -66,4 +69,4 @@ done
 
 salt -C '* and not cfg01* and not mas01*' saltutil.sync_all
 salt -C '* and not cfg01* and not mas01*' state.apply salt
-salt -C '* and not cfg01* and not mas01*' state.apply linux,ntp
+wait_for "salt -C '* and not cfg01* and not mas01*' state.apply linux,ntp"