Skip to content

Commit 57f915a

Browse files
committed
1 parent a6dcc39 commit 57f915a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tasks/install.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
package:
3939
name: "{{ package }}"
4040
state: present
41-
with_items: "{{ libvirt_host_qemu_emulators }}"
41+
loop: "{{ libvirt_host_qemu_emulators | flatten(levels=1) }}"
4242
# NOTE(mgoddard): CentOS 8 does not provide separate packages per-emulator.
4343
when: ansible_os_family != "RedHat" or ansible_distribution_major_version | int == 7
4444
register: result

tasks/pools.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
mode: "{{ item.mode|int(base=8) }}"
88
state: directory
99
when: item.type == "dir"
10-
with_items: "{{ libvirt_host_pools }}"
10+
loop: "{{ libvirt_host_pools | flatten(levels=1) }}"
1111
become: True
1212

1313
- name: Ensure libvirt LVM storage pool directories exist
1414
lvg:
1515
vg: "{{ item.source }}"
1616
pvs: "{{ item.pvs }}"
1717
when: item.type in ["lvm2", "logical"]
18-
with_items: "{{ libvirt_host_pools }}"
18+
loop: "{{ libvirt_host_pools | flatten(levels=1) }}"
1919
become: True
2020

2121
- name: Ensure libvirt storage pools are defined
@@ -24,21 +24,21 @@
2424
command: define
2525
xml: "{{ item.xml | default(lookup('template', 'pool.xml.j2')) }}"
2626
uri: "{{ libvirt_host_uri | default(omit, true) }}"
27-
with_items: "{{ libvirt_host_pools }}"
27+
loop: "{{ libvirt_host_pools | flatten(levels=1) }}"
2828
become: True
2929

3030
- name: Ensure libvirt storage pools are active
3131
virt_pool:
3232
name: "{{ item.name }}"
3333
state: active
3434
uri: "{{ libvirt_host_uri | default(omit, true) }}"
35-
with_items: "{{ libvirt_host_pools }}"
35+
loop: "{{ libvirt_host_pools | flatten(levels=1) }}"
3636
become: True
3737

3838
- name: Ensure libvirt storage pools are started on boot
3939
virt_pool:
4040
name: "{{ item.name }}"
4141
autostart: yes
4242
uri: "{{ libvirt_host_uri | default(omit, true) }}"
43-
with_items: "{{ libvirt_host_pools }}"
43+
loop: "{{ libvirt_host_pools | flatten(levels=1) }}"
4444
become: True

0 commit comments

Comments
 (0)