Use new loop_control/loop_var constructs from Ansible devel

Ansible now allows you to name the loop var, fixing nested
with_items include issue:

https://github.com/ansible/ansible/issues/14146#

Switching to it for making role future proof.
This commit is contained in:
Ricardo Carrillo Cruz 2016-04-25 02:55:50 +00:00
parent 084231bfc3
commit 691970f923
2 changed files with 80 additions and 83 deletions

View File

@ -1,22 +1,17 @@
--- ---
- set_fact: - name: Create per-cloud domains for cloud "{{ item_cloud.name }}"
clouds_loop: "{{ item }}"
tags:
- always
- name: Create per-cloud domains for cloud "{{ clouds_loop.name }}"
os_keystone_domain: os_keystone_domain:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.state|default(omit) }}" state: "{{ item.state|default(omit) }}"
name: "{{ item.name }}" name: "{{ item.name }}"
description: "{{ item.description|default(omit) }}" description: "{{ item.description|default(omit) }}"
with_items: "{{ clouds_loop.domains|default([]) }}" with_items: "{{ item_cloud.domains|default([]) }}"
tags: tags:
- domains - domains
- name: Create profiles domains for cloud {{ clouds_loop.name }} - name: Create profiles domains for cloud {{ item_cloud.name }}
os_keystone_domain: os_keystone_domain:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.1.state|default(omit) }}" state: "{{ item.1.state|default(omit) }}"
name: "{{ item.1.name }}" name: "{{ item.1.name }}"
description: "{{ item.1.description|default(omit) }}" description: "{{ item.1.description|default(omit) }}"
@ -24,24 +19,24 @@
- "{{ profiles }}" - "{{ profiles }}"
- domains - domains
- { skip_missing: yes } - { skip_missing: yes }
when: "{{ item.0.name in clouds_loop.profiles }}" when: "{{ item.0.name in item_cloud.profiles }}"
tags: tags:
- domains - domains
- name: Create per-cloud projects for cloud {{ clouds_loop.name }} - name: Create per-cloud projects for cloud {{ item_cloud.name }}
os_project: os_project:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.state|default(omit) }}" state: "{{ item.state|default(omit) }}"
name: "{{ item.name }}" name: "{{ item.name }}"
description: "{{ item.description|default(omit) }}" description: "{{ item.description|default(omit) }}"
domain: "{{ item.domain|default(omit) }}" domain: "{{ item.domain|default(omit) }}"
with_items: "{{ clouds_loop.projects|default([]) }}" with_items: "{{ item_cloud.projects|default([]) }}"
tags: tags:
- projects - projects
- name: Create profiles projects for cloud {{ clouds_loop.name }} - name: Create profiles projects for cloud {{ item_cloud.name }}
os_project: os_project:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.1.state|default(omit) }}" state: "{{ item.1.state|default(omit) }}"
name: "{{ item.1.name }}" name: "{{ item.1.name }}"
description: "{{ item.1.description|default(omit) }}" description: "{{ item.1.description|default(omit) }}"
@ -50,26 +45,26 @@
- "{{ profiles }}" - "{{ profiles }}"
- projects - projects
- { skip_missing: yes} - { skip_missing: yes}
when: "{{ item.0.name in clouds_loop.profiles }}" when: "{{ item.0.name in item_cloud.profiles }}"
tags: tags:
- projects - projects
- name: Create per-cloud users for cloud {{ clouds_loop.name }} - name: Create per-cloud users for cloud {{ item_cloud.name }}
os_user: os_user:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.state|default(omit) }}" state: "{{ item.state|default(omit) }}"
name: "{{ item.name }}" name: "{{ item.name }}"
password: "{{ item.password }}" password: "{{ item.password }}"
email: "{{ item.email|default(omit) }}" email: "{{ item.email|default(omit) }}"
domain: "{{ item.domain|default(omit) }}" domain: "{{ item.domain|default(omit) }}"
default_project: "{{ item.default_project|default(omit) }}" default_project: "{{ item.default_project|default(omit) }}"
with_items: "{{ clouds_loop.users|default([]) }}" with_items: "{{ item_cloud.users|default([]) }}"
tags: tags:
- users - users
- name: Create profiles users for cloud {{ clouds_loop.name }} - name: Create profiles users for cloud {{ item_cloud.name }}
os_user: os_user:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.1.state|default(omit) }}" state: "{{ item.1.state|default(omit) }}"
name: "{{ item.1.name }}" name: "{{ item.1.name }}"
password: "{{ item.1.password }}" password: "{{ item.1.password }}"
@ -80,24 +75,24 @@
- "{{ profiles }}" - "{{ profiles }}"
- users - users
- { skip_missing: yes} - { skip_missing: yes}
when: "{{ item.0.name in clouds_loop.profiles }}" when: "{{ item.0.name in item_cloud.profiles }}"
tags: tags:
- users - users
- name: Create per-cloud networks for {{ clouds_loop.name }} - name: Create per-cloud networks for {{ item_cloud.name }}
os_network: os_network:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.1.state|default(omit) }}" state: "{{ item.1.state|default(omit) }}"
name: "{{ item.name }}" name: "{{ item.name }}"
external: "{{ item.external|default(omit) }}" external: "{{ item.external|default(omit) }}"
project: "{{ item.project|default(omit) }}" project: "{{ item.project|default(omit) }}"
with_items: "{{ clouds_loop.networks|default([]) }}" with_items: "{{ item_cloud.networks|default([]) }}"
tags: tags:
- networks - networks
- name: Create profiles networks for {{ clouds_loop.name }} - name: Create profiles networks for {{ item_cloud.name }}
os_network: os_network:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.1.state|default(omit) }}" state: "{{ item.1.state|default(omit) }}"
name: "{{ item.1.name }}" name: "{{ item.1.name }}"
external: "{{ item.1.external|default(omit) }}" external: "{{ item.1.external|default(omit) }}"
@ -106,25 +101,25 @@
- "{{ profiles }}" - "{{ profiles }}"
- networks - networks
- { skip_missing: yes} - { skip_missing: yes}
when: "{{ item.0.name in clouds_loop.profiles }}" when: "{{ item.0.name in item_cloud.profiles }}"
tags: tags:
- networks - networks
- name: Create per-cloud subnets for cloud {{ clouds_loop.name }} - name: Create per-cloud subnets for cloud {{ item_cloud.name }}
os_subnet: os_subnet:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.state|default(omit) }}" state: "{{ item.state|default(omit) }}"
name: "{{ item.name }}" name: "{{ item.name }}"
network_name: "{{ item.network_name|default(omit) }}" network_name: "{{ item.network_name|default(omit) }}"
cidr: "{{ item.cidr }}" cidr: "{{ item.cidr }}"
dns_nameservers: "{{ item.dns_nameservers|default(omit) }}" dns_nameservers: "{{ item.dns_nameservers|default(omit) }}"
with_items: "{{ clouds_loop.subnets|default([]) }}" with_items: "{{ item_cloud.subnets|default([]) }}"
tags: tags:
- subnets - subnets
- name: Create profiles subnets for {{ clouds_loop.name }} - name: Create profiles subnets for {{ item_cloud.name }}
os_subnet: os_subnet:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.1.state|default(omit) }}" state: "{{ item.1.state|default(omit) }}"
name: "{{ item.1.name }}" name: "{{ item.1.name }}"
network_name: "{{ item.1.network_name|default(omit) }}" network_name: "{{ item.1.network_name|default(omit) }}"
@ -134,13 +129,13 @@
- "{{ profiles }}" - "{{ profiles }}"
- subnets - subnets
- { skip_missing: yes } - { skip_missing: yes }
when: "{{ item.0.name in clouds_loop.profiles }}" when: "{{ item.0.name in item_cloud.profiles }}"
tags: tags:
- subnets - subnets
- name: Create per-cloud routers for cloud {{ clouds_loop.name }} - name: Create per-cloud routers for cloud {{ item_cloud.name }}
os_router: os_router:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.state|default(omit) }}" state: "{{ item.state|default(omit) }}"
name: "{{ item.name }}" name: "{{ item.name }}"
network: "{{ item.network }}" network: "{{ item.network }}"
@ -148,13 +143,13 @@
enable_snat: "{{ item.enable_snat|default(omit) }}" enable_snat: "{{ item.enable_snat|default(omit) }}"
external_fixed_ips: "{{ item.external_fixed_ips|default(omit) }}" external_fixed_ips: "{{ item.external_fixed_ips|default(omit) }}"
interfaces: "{{ item.interfaces|default(omit) }}" interfaces: "{{ item.interfaces|default(omit) }}"
with_items: "{{ clouds_loop.subnets|default([]) }}" with_items: "{{ item_cloud.subnets|default([]) }}"
tags: tags:
- routers - routers
- name: Create profiles routers for {{ clouds_loop.name }} - name: Create profiles routers for {{ item_cloud.name }}
os_router: os_router:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.1.state|default(omit) }}" state: "{{ item.1.state|default(omit) }}"
name: "{{ item.1.name }}" name: "{{ item.1.name }}"
network: "{{ item.1.network }}" network: "{{ item.1.network }}"
@ -166,13 +161,13 @@
- "{{ profiles }}" - "{{ profiles }}"
- routers - routers
- { skip_missing: yes } - { skip_missing: yes }
when: "{{ item.0.name in clouds_loop.profiles }}" when: "{{ item.0.name in item_cloud.profiles }}"
tags: tags:
- routers - routers
- name: Create per-cloud flavors for {{ clouds_loop.name }} - name: Create per-cloud flavors for {{ item_cloud.name }}
os_nova_flavor: os_nova_flavor:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.state|default(omit) }}" state: "{{ item.state|default(omit) }}"
name: "{{ item.name }}" name: "{{ item.name }}"
vcpus: "{{ item.vcpus }}" vcpus: "{{ item.vcpus }}"
@ -181,13 +176,13 @@
swap: "{{ item.swap|default(omit) }}" swap: "{{ item.swap|default(omit) }}"
ephemeral: "{{ item.ephemeral|default(omit) }}" ephemeral: "{{ item.ephemeral|default(omit) }}"
rxtx_factor: "{{ item.rxtx_factor|default(omit) }}" rxtx_factor: "{{ item.rxtx_factor|default(omit) }}"
with_items: "{{ clouds_loop.flavors|default([]) }}" with_items: "{{ item_cloud.flavors|default([]) }}"
tags: tags:
- flavors - flavors
- name: Create profiles flavors for {{ clouds_loop.name }} - name: Create profiles flavors for {{ item_cloud.name }}
os_nova_flavor: os_nova_flavor:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.1.state|default(omit) }}" state: "{{ item.1.state|default(omit) }}"
name: "{{ item.1.name }}" name: "{{ item.1.name }}"
vcpus: "{{ item.1.vcpus }}" vcpus: "{{ item.1.vcpus }}"
@ -200,13 +195,13 @@
- "{{ profiles }}" - "{{ profiles }}"
- flavors - flavors
- { skip_missing: yes } - { skip_missing: yes }
when: "{{ item.0.name in clouds_loop.profiles }}" when: "{{ item.0.name in item_cloud.profiles }}"
tags: tags:
- flavors - flavors
- name: Create per-cloud images for {{ clouds_loop.name }} - name: Create per-cloud images for {{ item_cloud.name }}
os_image: os_image:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.state|default(omit) }}" state: "{{ item.state|default(omit) }}"
name: "{{ item.name }}" name: "{{ item.name }}"
container_format: "{{ item.container_format|default(omit) }}" container_format: "{{ item.container_format|default(omit) }}"
@ -219,13 +214,13 @@
owner: "{{ item.owner|default(omit) }}" owner: "{{ item.owner|default(omit) }}"
properties: "{{ item.properties|default(omit) }}" properties: "{{ item.properties|default(omit) }}"
is_public: "{{ item.is_public|default(omit) }}" is_public: "{{ item.is_public|default(omit) }}"
with_items: "{{ clouds_loop.images|default([]) }}" with_items: "{{ item_cloud.images|default([]) }}"
tags: tags:
- images - images
- name: Create profiles images for {{ clouds_loop.name }} - name: Create profiles images for {{ item_cloud.name }}
os_image: os_image:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.1.state|default(omit) }}" state: "{{ item.1.state|default(omit) }}"
name: "{{ item.1.name }}" name: "{{ item.1.name }}"
container_format: "{{ item.1.container_format|default(omit) }}" container_format: "{{ item.1.container_format|default(omit) }}"
@ -242,23 +237,23 @@
- "{{ profiles }}" - "{{ profiles }}"
- images - images
- { skip_missing: yes } - { skip_missing: yes }
when: "{{ item.0.name in clouds_loop.profiles }}" when: "{{ item.0.name in item_cloud.profiles }}"
tags: tags:
- images - images
- name: Create per-cloud security groups for {{ clouds_loop.name }} - name: Create per-cloud security groups for {{ item_cloud.name }}
os_security_group: os_security_group:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.state|default(omit) }}" state: "{{ item.state|default(omit) }}"
name: "{{ item.name }}" name: "{{ item.name }}"
description: "{{ item.description|default(omit) }}" description: "{{ item.description|default(omit) }}"
with_items: "{{ clouds_loop.security_groups|default([]) }}" with_items: "{{ item_cloud.security_groups|default([]) }}"
tags: tags:
- security_groups - security_groups
- name: Create profiles security groups for {{ clouds_loop.name }} - name: Create profiles security groups for {{ item_cloud.name }}
os_security_group: os_security_group:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.1.state|default(omit) }}" state: "{{ item.1.state|default(omit) }}"
name: "{{ item.1.name }}" name: "{{ item.1.name }}"
description: "{{ item.1.description|default(omit) }}" description: "{{ item.1.description|default(omit) }}"
@ -266,13 +261,13 @@
- "{{ profiles }}" - "{{ profiles }}"
- security_groups - security_groups
- { skip_missing: yes } - { skip_missing: yes }
when: "{{ item.0.name in clouds_loop.profiles }}" when: "{{ item.0.name in item_cloud.profiles }}"
tags: tags:
- security_groups - security_groups
- name: Create per-cloud security groups rules for {{ clouds_loop.name }} - name: Create per-cloud security groups rules for {{ item_cloud.name }}
os_security_group_rule: os_security_group_rule:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.state|default(omit) }}" state: "{{ item.state|default(omit) }}"
security_group: "{{ item.security_group }}" security_group: "{{ item.security_group }}"
direction: "{{ item.direction|default(omit) }}" direction: "{{ item.direction|default(omit) }}"
@ -282,13 +277,13 @@
protocol: "{{ item.protocol|default(omit) }}" protocol: "{{ item.protocol|default(omit) }}"
remote_group: "{{ item.remote_group|default(omit) }}" remote_group: "{{ item.remote_group|default(omit) }}"
remote_ip_prefix: "{{ item.remote_ip_prefix|default(omit) }}" remote_ip_prefix: "{{ item.remote_ip_prefix|default(omit) }}"
with_items: "{{ clouds_loop.security_groups_rules|default([]) }}" with_items: "{{ item_cloud.security_groups_rules|default([]) }}"
tags: tags:
- security_groups_rules - security_groups_rules
- name: Create profiles security groups rules for {{ clouds_loop.name }} - name: Create profiles security groups rules for {{ item_cloud.name }}
os_security_group_rule: os_security_group_rule:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.1.state|default(omit) }}" state: "{{ item.1.state|default(omit) }}"
security_group: "{{ item.1.security_group }}" security_group: "{{ item.1.security_group }}"
direction: "{{ item.1.direction|default(omit) }}" direction: "{{ item.1.direction|default(omit) }}"
@ -302,24 +297,24 @@
- "{{ profiles }}" - "{{ profiles }}"
- security_groups_rules - security_groups_rules
- { skip_missing: yes } - { skip_missing: yes }
when: "{{ item.0.name in clouds_loop.profiles }}" when: "{{ item.0.name in item_cloud.profiles }}"
tags: tags:
- security_groups_rules - security_groups_rules
- name: Create per-cloud keypairs for {{ clouds_loop.name }} - name: Create per-cloud keypairs for {{ item_cloud.name }}
os_keypair: os_keypair:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.state|default(omit) }}" state: "{{ item.state|default(omit) }}"
name: "{{ item.name }}" name: "{{ item.name }}"
public_key: "{{ item.public_key|default(omit) }}" public_key: "{{ item.public_key|default(omit) }}"
public_key_file: "{{ item.public_key_file|default(omit) }}" public_key_file: "{{ item.public_key_file|default(omit) }}"
with_items: "{{ clouds_loop.keypairs|default([]) }}" with_items: "{{ item_cloud.keypairs|default([]) }}"
tags: tags:
- keypairs - keypairs
- name: Create profiles keypairs rules for {{ clouds_loop.name }} - name: Create profiles keypairs rules for {{ item_cloud.name }}
os_keypair: os_keypair:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.1.state|default(omit) }}" state: "{{ item.1.state|default(omit) }}"
name: "{{ item.1.name }}" name: "{{ item.1.name }}"
public_key: "{{ item.1.public_key|default(omit) }}" public_key: "{{ item.1.public_key|default(omit) }}"
@ -328,13 +323,13 @@
- "{{ profiles }}" - "{{ profiles }}"
- keypairs - keypairs
- { skip_missing: yes } - { skip_missing: yes }
when: "{{ item.0.name in clouds_loop.profiles }}" when: "{{ item.0.name in item_cloud.profiles }}"
tags: tags:
- keypairs - keypairs
- name: Create per-cloud volumes for {{ clouds_loop.name }} - name: Create per-cloud volumes for {{ item_cloud.name }}
os_volume: os_volume:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.state|default(omit) }}" state: "{{ item.state|default(omit) }}"
name: "{{ item.name }}" name: "{{ item.name }}"
size: "{{ item.size }}" size: "{{ item.size }}"
@ -343,13 +338,13 @@
key: "{{ item.key|default(omit) }}" key: "{{ item.key|default(omit) }}"
snapshot_id: "{{ item.snapshot_id|default(omit) }}" snapshot_id: "{{ item.snapshot_id|default(omit) }}"
volume_type: "{{ item.volume_type|default(omit) }}" volume_type: "{{ item.volume_type|default(omit) }}"
with_items: "{{ clouds_loop.volumes|default([]) }}" with_items: "{{ item_cloud.volumes|default([]) }}"
tags: tags:
- volumes - volumes
- name: Create profiles volumes for {{ clouds_loop.name }} - name: Create profiles volumes for {{ item_cloud.name }}
os_volume: os_volume:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.1.state|default(omit) }}" state: "{{ item.1.state|default(omit) }}"
name: "{{ item.1.name }}" name: "{{ item.1.name }}"
size: "{{ item.1.size }}" size: "{{ item.1.size }}"
@ -362,13 +357,13 @@
- "{{ profiles }}" - "{{ profiles }}"
- volumes - volumes
- { skip_missing: yes } - { skip_missing: yes }
when: "{{ item.0.name in clouds_loop.profiles }}" when: "{{ item.0.name in item_cloud.profiles }}"
tags: tags:
- volumes - volumes
- name: Create per-cloud servers for {{ clouds_loop.name }} - name: Create per-cloud servers for {{ item_cloud.name }}
os_server: os_server:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.state|default(omit) }}" state: "{{ item.state|default(omit) }}"
name: "{{ item.name }}" name: "{{ item.name }}"
image: "{{ item.image }}" image: "{{ item.image }}"
@ -393,13 +388,13 @@
userdata: "{{ item.userdata|default(omit) }}" userdata: "{{ item.userdata|default(omit) }}"
volume_size: "{{ item.volume_size|default(omit) }}" volume_size: "{{ item.volume_size|default(omit) }}"
volumes: "{{ item.volumes|default(omit) }}" volumes: "{{ item.volumes|default(omit) }}"
with_items: "{{ clouds_loop.servers|default([]) }}" with_items: "{{ item_cloud.servers|default([]) }}"
tags: tags:
- servers - servers
- name: Create profiles servers for {{ clouds_loop.name }} - name: Create profiles servers for {{ item_cloud.name }}
os_server: os_server:
cloud: "{{ clouds_loop.oscc_cloud|default(clouds_loop.name) }}" cloud: "{{ item_cloud.oscc_cloud|default(item_cloud.name) }}"
state: "{{ item.1.state|default(omit) }}" state: "{{ item.1.state|default(omit) }}"
name: "{{ item.1.name }}" name: "{{ item.1.name }}"
image: "{{ item.1.image }}" image: "{{ item.1.image }}"
@ -428,6 +423,6 @@
- "{{ profiles }}" - "{{ profiles }}"
- servers - servers
- { skip_missing: yes } - { skip_missing: yes }
when: "{{ item.0.name in clouds_loop.profiles }}" when: "{{ item.0.name in item_cloud.profiles }}"
tags: tags:
- servers - servers

View File

@ -1,3 +1,5 @@
--- ---
- include: create_clouds_resources.yml - include: create_clouds_resources.yml
with_items: "{{ clouds }}" with_items: "{{ clouds }}"
loop_control:
loop_var: item_cloud