Skip to content

Commit

Permalink
fix: Remove pipefail option
Browse files Browse the repository at this point in the history
Remove pipefail option and simplify loop definition.

Signed-off-by: Klaus Smolin <smolin@de.ibm.com>
  • Loading branch information
smolin-de committed Mar 8, 2024
1 parent 2ad7ce8 commit 340de74
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions roles/delete_nodes/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@
- name: Delete control, compute and infra nodes, if exists
tags: delete_nodes
ansible.builtin.shell: |
set -o pipefail
virsh destroy {{ item }} || true
virsh undefine {{ item }} --remove-all-storage --nvram || true
loop: "{{ env.cluster.nodes.control.vm_name + env.cluster.nodes.compute.vm_name \
if env.cluster.nodes.infra.vm_name is not defined \
else env.cluster.nodes.control.vm_name + env.cluster.nodes.compute.vm_name + env.cluster.nodes.infra.vm_name }}"
loop: "{{ env.cluster.nodes.control.vm_name + \
(env.cluster.nodes.compute.vm_name | default([])) + (env.cluster.nodes.infra.vm_name | default([])) }}"
register: delete_nodes
changed_when: "('destroyed' in delete_nodes.stdout) or ('undefined' in delete_nodes.stdout)"

Expand Down

0 comments on commit 340de74

Please sign in to comment.