Formatting fixes
Fix multi-line string variables. Also use subelements filter with loop.
This commit is contained in:
@@ -14,13 +14,16 @@
|
||||
|
||||
- hosts: hypervisors
|
||||
tasks:
|
||||
- include_tasks: vm_networking.yml
|
||||
- include_tasks: vm_physical_network.yml
|
||||
vars:
|
||||
vm: "{{ item }}"
|
||||
vm_name: "{{ item.0.name }}"
|
||||
physnet: "{{ item.1 }}"
|
||||
# Loop over each physical network for each VM allocated to this host.
|
||||
# Allocations are stored in the controller node's vars.
|
||||
loop: >
|
||||
loop: >-
|
||||
{{ hostvars[groups.controllers.0].allocations.result[
|
||||
inventory_hostname] | default([]) }}
|
||||
inventory_hostname] | default([])
|
||||
| subelements('physical_networks') }}
|
||||
|
||||
- hosts: libvirt
|
||||
tasks:
|
||||
@@ -37,9 +40,9 @@
|
||||
group: "{{ libvirt_pool_group }}"
|
||||
libvirt_host_require_vt: "{{ libvirt_require_vt }}"
|
||||
|
||||
- include_tasks: create_libvirt_vms.yml
|
||||
- include_tasks: libvirt_create_vms.yml
|
||||
vars:
|
||||
# Allocations are stored in the controller node's vars.
|
||||
vms: >
|
||||
vms: >-
|
||||
{{ hostvars[groups.controllers.0].allocations.result[
|
||||
inventory_hostname] | default([]) }}
|
||||
|
||||
Reference in New Issue
Block a user