[fix][wip] Add reinstall_init function (part 3)

Create a function that, if the setup log exists, puts the system into a state where
the installer can run again without issue.

This is WIP, there are most likely still issues.
This commit is contained in:
William Wernert
2020-11-04 10:38:48 -05:00
parent db31cf3083
commit 49af35b440

View File

@@ -1424,9 +1424,12 @@ reinstall_init() {
# Disable schedule so highstate doesn't start running during the install
salt-call -l info schedule.disable
# Kill any currently running salt jobs, also to prevent issues with highstate.
salt-call -l info saltutil.kill_all_jobs
# Stop and remove all so-* containers so files can be changed with more safety
docker stop $(docker ps -a -q --filter "name=so-")
docker rm $(docker ps -a -q --filter "name=so-")
docker rm -f $(docker ps -a -q --filter "name=so-")
# Backup /opt/so since we'll be rebuilding this directory during setup
mv /opt/so /opt/so_old