cleanup salt more strict
* finally satisfy salt - add virt-what pkg by default for all.
* set default log_file: /var/log/salt/(minion|master)
For some reason salt 2017.7.5+ds-1 ignore default values and stuck after
restart with
2018-07-19 20:04:04,811 [salt.log.setup :1145][ERROR ][32030] An un-handled exception was caught by salt's global exception handler:
IOError: [Errno 9] Bad file descriptor
IOError: [Errno 9] Bad file descriptor
Change-Id: I276e410a86ba8f8ad8f68b110a90408558800d70
diff --git a/common/ubuntu_cleanup_salt.sh b/common/ubuntu_cleanup_salt.sh
index 4e77783..13420da 100644
--- a/common/ubuntu_cleanup_salt.sh
+++ b/common/ubuntu_cleanup_salt.sh
@@ -2,6 +2,8 @@
apt-get purge salt-formula-* -y
+salt-call saltutil.clear_cache || true
+
echo "removing all previously accepted salt keys"
salt-key -D -y || true
@@ -16,13 +18,16 @@
# stop and disable services, for healthy zerodisk
# They should be enabled after VCP init
-stop_services="salt-api salt-master salt-minion"
+stop_services="salt-minion salt-master salt-api"
for s in ${stop_services} ; do
systemctl stop ${s} || true
# Enable this, after refactoring salt:control:virtng
# systemctl disable ${s} || true
done
+# remove all keys at all
+rm -rf /etc/salt/pki/* || true
+
# Clear\drop cache's
sync
echo 3 > /proc/sys/vm/drop_caches