hpc-cloud/nuke.yml

29 lines
789 B
YAML
Raw Normal View History

2018-01-30 09:57:11 +01:00
---
2018-02-06 13:34:56 +01:00
# This playbook will reset the instalation to facilitate a new installation.
# All data is lost!
2018-01-30 09:57:11 +01:00
- hosts: all
2018-07-19 13:19:25 +02:00
become: true
2018-01-30 09:57:11 +01:00
name: Dummy to gather facts
tasks:
- name: Stop docker service
2018-02-16 11:45:53 +01:00
shell: "systemctl stop docker"
2018-02-06 13:34:56 +01:00
- name: Verify docker is stopped.
2018-01-30 09:57:11 +01:00
systemd:
name: docker
state: stopped
- name: remove volumes
shell: "rm -rf /srv"
2018-07-19 13:19:25 +02:00
- name: remove network namespaces
shell: "rm /var/run/netns/*"
ignore_errors: true
2018-01-30 09:57:11 +01:00
2018-07-18 14:05:27 +02:00
- hosts: nova-compute
gather_facts: false
2018-07-19 13:19:25 +02:00
become: true
2018-07-18 14:05:27 +02:00
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"