File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
ansible/roles/create-vm/tasks Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change 66 command : list_vms
77 register : all_vms
88
9- - name : find VMs that start with "microshift-*"
10- set_fact :
11- vm_match : " {{ all_vms.list_vms | join(' ') | regex_findall('microshift-\\ S+', multiline=True, ignorecase=True) }}"
12-
13- - name : destroy microshift VM
9+ - name : destroy target VM if present
1410 community.libvirt.virt :
15- name : " {{ item }}"
11+ name : " {{ vm_name }}"
1612 state : destroyed
17- loop : " {{ vm_match }} "
13+ when : vm_name in (all_vms.list_vms | default([]))
1814
19- - name : undefine microshift VM
15+ - name : undefine target VM if present
2016 community.libvirt.virt :
21- name : " {{ item }}"
17+ name : " {{ vm_name }}"
2218 command : undefine
23- loop : " {{ vm_match }} "
19+ when : vm_name in (all_vms.list_vms | default([]))
2420
2521- name : find create-vm.sh
2622 ansible.builtin.find :
You can’t perform that action at this time.
0 commit comments