add states to remove ca and ssl keys and certs and call them during reinstall.

This commit is contained in:
m0duspwnens
2022-01-26 09:33:19 -05:00
parent 8ce0f5b7be
commit 8aa002b82e
4 changed files with 165 additions and 1 deletions

View File

@@ -2060,7 +2060,7 @@ reinstall_init() {
{
# remove all of root's cronjobs
crontab -r -u root
logCmd "crontab -r -u root"
if command -v salt-call &> /dev/null && grep -q "master:" /etc/salt/minion 2> /dev/null; then
# Disable schedule so highstate doesn't start running during the install
@@ -2091,6 +2091,9 @@ reinstall_init() {
done
done
logCmd "salt-call state.apply ca.remove -linfo --local"
logCmd "salt-call state.apply ssl.remove -linfo --local"
# Remove all salt configs
rm -rf /etc/salt/engines/* /etc/salt/grains /etc/salt/master /etc/salt/master.d/* /etc/salt/minion /etc/salt/minion.d/* /etc/salt/pki/* /etc/salt/proxy /etc/salt/proxy.d/* /var/cache/salt/
@@ -2122,10 +2125,13 @@ reinstall_init() {
remove_package launcher-final
if [[ $OS == 'ubuntu' ]]; then
info "Unholding previously held packages."
apt-mark unhold $(apt-mark showhold)
fi
} >> "$setup_log" 2>&1
info "System reinstall init has been completed."
}
reset_proxy() {