summaryrefslogtreecommitdiffstats
path: root/mcp/config/states/maas
diff options
context:
space:
mode:
Diffstat (limited to 'mcp/config/states/maas')
-rwxr-xr-xmcp/config/states/maas3
1 files changed, 3 insertions, 0 deletions
diff --git a/mcp/config/states/maas b/mcp/config/states/maas
index 0c016170c..73deb48c0 100755
--- a/mcp/config/states/maas
+++ b/mcp/config/states/maas
@@ -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 | " \