blob: 69509b599e06bf807252a3d9fd36cfcd76861b8d [file] [log] [blame]
#!/bin/bash -xe
# Duplicate of ubuntu_info.sh
mkdir -p /var/log/bootstrap_logs/
pushd /var/log/bootstrap_logs/
dpkg-query -W -f='${Package}=${Version}\n' | sort -u |tee -a vcp_initial_pkgs.log
# Drop some reclass info,if available
if [[ $(which salt-key) ]] ; then
for node in $(salt-key -l acc | grep -v 'Accepted Keys:') ; do
salt ${node} pillar.data --out=json > ${node}.pillardata.json || true
reclass -n ${node} -o json > ${node}.reclass.json || true
done
fi
popd
apt-get purge -y salt-formula-*
salt-call saltutil.clear_cache || true
echo "removing all previously accepted salt keys"
salt-key -D -y || true
echo "cleaning up reclass"
rm -rf /srv/salt/reclass || true
rm -rf /srv/salt/scripts || true
rm -rf /usr/share/salt-formulas/env || true
#
mkdir -p /srv/salt/reclass/
mkdir -p /usr/share/salt-formulas/reclass/service/
mkdir -p /usr/share/salt-formulas/env/
# stop and disable services, for healthy zerodisk
# They should be enabled after VCP init
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
# Remove salt-master from apt01
if [[ "$(hostname)" == *"apt01"* ]] ; then
apt-get purge -y salt-master
rm -rfv /etc/salt/master.d || true
fi
# Clear\drop cache's
sync
echo 3 > /proc/sys/vm/drop_caches