blob: db140a56b66f0c63415c6a20eee18523998c4c4c [file] [log] [blame]
azvyagintsev29410ee2018-07-12 20:02:30 +03001#!/bin/bash -xe
2
azvyagintsev547dcae2018-07-27 13:58:26 +03003apt-get purge -y salt-formula-*
azvyagintsev29410ee2018-07-12 20:02:30 +03004
azvyagintsev73fff7f2018-07-19 23:11:36 +03005salt-call saltutil.clear_cache || true
6
azvyagintsev29410ee2018-07-12 20:02:30 +03007echo "removing all previously accepted salt keys"
8salt-key -D -y || true
9
10echo "cleaning up reclass"
11rm -rf /srv/salt/reclass || true
12rm -rf /srv/salt/scripts || true
13rm -rf /usr/share/salt-formulas/env || true
14#
15mkdir -p /srv/salt/reclass/
16mkdir -p /usr/share/salt-formulas/reclass/service/
17mkdir -p /usr/share/salt-formulas/env/
18
19# stop and disable services, for healthy zerodisk
20# They should be enabled after VCP init
azvyagintsev73fff7f2018-07-19 23:11:36 +030021stop_services="salt-minion salt-master salt-api"
azvyagintsev29410ee2018-07-12 20:02:30 +030022for s in ${stop_services} ; do
23 systemctl stop ${s} || true
24# Enable this, after refactoring salt:control:virtng
25# systemctl disable ${s} || true
26done
27
azvyagintsev73fff7f2018-07-19 23:11:36 +030028# remove all keys at all
29rm -rf /etc/salt/pki/* || true
30
azvyagintsev547dcae2018-07-27 13:58:26 +030031# Remove salt-master from apt01
32if [[ "$(hostname)" == *"apt01"* ]] ; then
33 apt-get purge -y salt-master
34 rm -rfv /etc/salt/master.d || true
35fi
36
azvyagintsev29410ee2018-07-12 20:02:30 +030037# Clear\drop cache's
38sync
39echo 3 > /proc/sys/vm/drop_caches