Skip to content

Commit

Permalink
ansible: avoid lvmcluster tasks for empty cluster name
Browse files Browse the repository at this point in the history
Signed-off-by: Kees Bakker <[email protected]>
  • Loading branch information
keestux committed Jun 27, 2024
1 parent b0e124b commit 23de34c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ansible/books/lvmcluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
template:
src: "../files/lvmcluster/host_id.yaml.tpl"
dest: "../data/lvmcluster/{{ task_name }}/host_id.yaml"
when: 'task_name'
vars:
task_host_ids: "{{ lookup('file', '../data/lvmcluster/' + task_name + '/host_id.yaml') | from_yaml }}"

Expand All @@ -57,6 +58,7 @@
template:
src: ../files/lvmcluster/lvmlocal.conf.tpl
dest: /etc/lvm/lvmlocal.conf
when: 'task_name'

- name: LVM Cluster - Create VGs
hosts: all
Expand All @@ -70,7 +72,7 @@
shell:
cmd: "vgs {{ item }}"
register: check
loop: "{{ lvmcluster_vgs.keys() }}"
loop: "{{ task_vgs.keys() }}"
run_once: true
changed_when: false
failed_when: "check.rc not in (0, 5)"
Expand Down

0 comments on commit 23de34c

Please sign in to comment.