From b24bbb99bdf5c09273e360aabf85b2c84573326e Mon Sep 17 00:00:00 2001 From: Michael Polenchuk Date: Mon, 21 Aug 2017 20:36:14 +0400 Subject: 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 --- mcp/config/states/maas | 3 +++ 1 file changed, 3 insertions(+) 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 | " \ -- cgit 1.2.3-korg