aboutsummaryrefslogtreecommitdiffstats
path: root/mcp/config/states
diff options
context:
space:
mode:
authorMichael Polenchuk <mpolenchuk@mirantis.com>2017-08-21 20:36:14 +0400
committerMichael Polenchuk <mpolenchuk@mirantis.com>2017-08-21 20:40:57 +0400
commitb24bbb99bdf5c09273e360aabf85b2c84573326e (patch)
tree71589e3eb8e8d15dc998671e5d592765381e203c /mcp/config/states
parentc77e7e79f11af144275feb3237de07d5fc79f2f6 (diff)
Cleanup outdated salt keys
Remove keys that are left over from the previous deployment to avoid interfere with the new ones. Change-Id: I0dfa9782cbce9a8e8b7c1efe5954c8ffe85996f9 Signed-off-by: Michael Polenchuk <mpolenchuk@mirantis.com>
Diffstat (limited to 'mcp/config/states')
-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 | " \