hpc-cloud/nuke.yml

34 lines
1.0 KiB
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
name: Cleanup tasks on all hosts.
2018-01-30 09:57:11 +01:00
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: Purge docker images.
shell: "rm -rf /var/lib/docker/"
2018-01-30 09:57:11 +01:00
- 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-08-09 13:52:04 +02:00
- name: Remove stale vxlan interfaces
2018-09-11 15:49:44 +02:00
shell: "for interface in $(ip link | grep DOWN | grep -Po 'vxlan-\\d{1,2}'); do ip link del $interface ; done"
2018-08-09 13:52:04 +02:00
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"