blob: fa505dfbe6fc5fb5f3f1b55aa6e3c466dab10bea [file] [log] [blame]
azvyagintsev29410ee2018-07-12 20:02:30 +03001#!/bin/bash -xe
2
azvyagintsev7a79c332018-10-17 16:30:43 +03003# Duplicate of ubuntu_info.sh
azvyagintsev05e84372018-10-17 17:31:28 +03004mkdir -p /var/log/bootstrap_logs/ ; pushd /var/log/bootstrap_logs/
5 dpkg-query -W -f='${Package}=${Version}\n' |tee -a vcp_initial_pkgs_stage_salt.log
azvyagintsev7a79c332018-10-17 16:30:43 +03006popd
7
azvyagintsev547dcae2018-07-27 13:58:26 +03008apt-get purge -y salt-formula-*
azvyagintsev29410ee2018-07-12 20:02:30 +03009
azvyagintsev73fff7f2018-07-19 23:11:36 +030010salt-call saltutil.clear_cache || true
11
azvyagintsev29410ee2018-07-12 20:02:30 +030012echo "removing all previously accepted salt keys"
13salt-key -D -y || true
14
15echo "cleaning up reclass"
16rm -rf /srv/salt/reclass || true
17rm -rf /srv/salt/scripts || true
18rm -rf /usr/share/salt-formulas/env || true
19#
20mkdir -p /srv/salt/reclass/
21mkdir -p /usr/share/salt-formulas/reclass/service/
22mkdir -p /usr/share/salt-formulas/env/
23
24# stop and disable services, for healthy zerodisk
25# They should be enabled after VCP init
azvyagintsev73fff7f2018-07-19 23:11:36 +030026stop_services="salt-minion salt-master salt-api"
azvyagintsev29410ee2018-07-12 20:02:30 +030027for s in ${stop_services} ; do
28 systemctl stop ${s} || true
29# Enable this, after refactoring salt:control:virtng
30# systemctl disable ${s} || true
31done
32
azvyagintsev73fff7f2018-07-19 23:11:36 +030033# remove all keys at all
34rm -rf /etc/salt/pki/* || true
35
azvyagintsev547dcae2018-07-27 13:58:26 +030036# Remove salt-master from apt01
37if [[ "$(hostname)" == *"apt01"* ]] ; then
38 apt-get purge -y salt-master
39 rm -rfv /etc/salt/master.d || true
40fi
41
Martin Polreich345f0de2019-01-24 15:04:44 +010042# remove logs
43rm -rf /var/log/salt/* || true
44
azvyagintsev29410ee2018-07-12 20:02:30 +030045# Clear\drop cache's
46sync
47echo 3 > /proc/sys/vm/drop_caches