You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the case when MAAS will be installed and reinstalled, sometimes with anvil, sometimes with snap or deb there needs to be a way how to cleanup and have environment ready for any other installation, so no leftovers prevent clean install with any of the possible methods.
There are basically two scenarios which needs to be covered
when anvil installation worked as expected, is it enough to run juju destroy-model?
when something goes wrong during install and juju cannot be used
The second scenario will leave postgres snap installed on the machine, it would have mounted data for example
I ended up using combination of these commands
juju destroy-model admin/controller
sudo /usr/sbin/remove-juju-services
sudo umount /var/snap/charmed-postgresql/common
sudo umount /var/lib/snapd/snaps/charmed-postgresql_96.snap
for i in charmed-postgresql juju juju-db maas maas-anvil ; do sudo snap remove $i --purge ; done
rm -rf ~/.local/share/juju
sudo pkill haproxy
It would be great to have some script with smarts which would take care of both successful and failed installation.
The text was updated successfully, but these errors were encountered:
Here is my big hammer temporary solution which seems to do the work. It is not nice at all but you may find some inspiration there
# timeout is set because I saw cases where it did not finish in 30 minutes and it was not progressing
ssh 10.244.40.30 "timeout 900 juju destroy-controller --destroy-all-models --destroy-storage --no-prompt anvil-controller"
for i in 30 31 32 ; do ssh 10.244.40.$i "sudo /usr/sbin/remove-juju-services" ; done
for i in 30 31 32 ; do ssh 10.244.40.$i "rm -rf .local/share/juju/" ; done
for i in 30 31 32 ; do ssh 10.244.40.$i "sudo snap stop charmed-postgresql" ; done
for i in 30 31 32 ; do ssh 10.244.40.$i "sudo umount /var/snap/charmed-postgresql/common; sudo umount /var/lib/snapd/snaps/charmed-postgresql_*.snap" ; done
for i in 30 31 32 ; do ssh 10.244.40.$i "for i in charmed-pgbouncer charmed-postgresql juju juju-db maas-anvil ; do sudo snap remove --purge \$i; done; sudo snap unalias patronictl"; done
for i in 30 31 32 ; do ssh 10.244.40.$i "sudo rm -rf /var/lib/juju" ; done
In the case when MAAS will be installed and reinstalled, sometimes with anvil, sometimes with snap or deb there needs to be a way how to cleanup and have environment ready for any other installation, so no leftovers prevent clean install with any of the possible methods.
There are basically two scenarios which needs to be covered
The second scenario will leave postgres snap installed on the machine, it would have mounted data for example
I ended up using combination of these commands
It would be great to have some script with smarts which would take care of both successful and failed installation.
The text was updated successfully, but these errors were encountered: