From 3369b5d9d9e08c5e98292b11341ca6b3f5e7d50b Mon Sep 17 00:00:00 2001 From: Egon Rijpkema Date: Wed, 18 Jul 2018 14:05:27 +0200 Subject: [PATCH] added virsh destroy to nuke --- nuke.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nuke.yml b/nuke.yml index 19c36e4..5bc0a48 100644 --- a/nuke.yml +++ b/nuke.yml @@ -14,3 +14,12 @@ - name: remove volumes shell: "rm -rf /srv" + +- 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"