Skip to content

Commit

Permalink
Ignore errors if there are no vms
Browse files Browse the repository at this point in the history
  • Loading branch information
Yolanda Robla committed Sep 23, 2020
1 parent f058aef commit f890c75
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions roles/installer/tasks/10_clean_bootstrap_vm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
shell: "virsh list --all --name | grep bootstrap-{{ cluster }}"
register: all_vms
become: yes
ignore_errors: true

- name: Get list of all running VMs
shell: "virsh list --name | grep bootstrap-{{ cluster }}"
register: running_vms
become: yes
ignore_errors: true

- name: Destroy old bootstrap VMs, if any
virt:
Expand Down
2 changes: 2 additions & 0 deletions roles/installer/tasks/15_clean_router_vm.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
- name: Get list of all VMs
shell: "virsh list --all --name | grep router-{{ cluster }}"
ignore_errors: true
register: all_vms
become: yes

- name: Get list of all running VMs
shell: "virsh list --name | grep router-{{ cluster }}"
register: running_vms
ignore_errors: true
become: yes

- name: Destroy old router VMs, if any
Expand Down
2 changes: 2 additions & 0 deletions roles/installer/tasks/20_clean_master_worker_vms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
shell: "virsh list --all --name | grep -E 'master-{{ cluster }}|worker-{{ cluster }}'"
register: all_vms
become: yes
ignore_errors: true

- name: Get list of all running VMs
shell: "virsh list --name | grep -E 'master-{{ cluster }}|worker-{{ cluster }}'"
register: running_vms
become: yes
ignore_errors: true

- name: Destroy old master/worker VMs, if any
virt:
Expand Down

0 comments on commit f890c75

Please sign in to comment.