Skip to content

Commit

Permalink
playbooks/cluster_setup_libvirt: fix empty string comparison
Browse files Browse the repository at this point in the history
var | length > 0 for var != ""
var | length == 0 for var == ""

Signed-off-by: Mathieu Dupré <[email protected]>
  • Loading branch information
dupremathieu committed Jun 5, 2023
1 parent 8f6e2fe commit ffe8d7b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions playbooks/cluster_setup_libvirt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@
loop: "{{ groups['hypervisors'] }}"
- debug:
msg: "Found UUID {{ libvirt_uuid_rbd }}"
when: libvirt_uuid_rbd
when: libvirt_uuid_rbd | length > 0
run_once: true
- name: Generate secret uuid
command: uuidgen
changed_when: false
register: raw_uuid
run_once: true
when: not libvirt_uuid_rbd
when: libvirt_uuid_rbd | length == 0
- name: Register uuid
set_fact:
libvirt_uuid_rbd: "{{ raw_uuid.stdout }}"
when: not libvirt_uuid_rbd
when: libvirt_uuid_rbd | length == 0
- name: Get Ceph libvirt client key
command: ceph auth get-key client.libvirt
changed_when: false
Expand Down

0 comments on commit ffe8d7b

Please sign in to comment.