hpc-cloud/nuke.yml
2018-07-19 13:19:25 +02:00

29 lines
789 B
YAML

---
# This playbook will reset the instalation to facilitate a new installation.
# All data is lost!
- hosts: all
become: true
name: Dummy to gather facts
tasks:
- name: Stop docker service
shell: "systemctl stop docker"
- name: Verify docker is stopped.
systemd:
name: docker
state: stopped
- name: remove volumes
shell: "rm -rf /srv"
- name: remove network namespaces
shell: "rm /var/run/netns/*"
ignore_errors: true
- hosts: nova-compute
gather_facts: false
become: true
tasks:
- name: kill all vm's
shell: "for machine in $(virsh list --uuid ); do virsh destroy $machine ; done"
- name: wipe all vm's
shell: "for machine in $(virsh list --uuid --all); do virsh undefine $machine ; done"