ansible-role-cloud-launcher/tasks/create_per_cloud_profiles_resources.yml
Clark Boylan 472065fb05 Don't use deprecated when jinja2 syntax
Under current ansible 2.6 we get the following warning type when running
the cloud launcher:

  [WARNING]: when statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: {{ 'security_groups_rules' in profiles|selectattr('name', 'equalto', item_profile)|list|first }}

Fix this by removing the outer {{ }} from the when statement strings.

Change-Id: I71363f628a8c03784f2ea3fc7082246a6f092f36
2018-09-06 13:53:09 -07:00

145 lines
5.7 KiB
YAML

---
- name: "Processing domains resources for profile {{ item_profile }}"
include: create_domain.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='domains')|list }}"
loop_control:
loop_var: item_domain
when: "'domains' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags:
- domains
- name: "Processing projects resources for profile {{ item_profile }}"
include: create_project.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='projects')|list }}"
loop_control:
loop_var: item_project
when: "'projects' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags:
- projects
- name: "Processing users resources for profile {{ item_profile }}"
include: create_user.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='users')|list }}"
loop_control:
loop_var: item_user
when: "'users' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags:
- users
- name: "Processing roles resources for profile {{ item_profile }}"
include: create_role.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='roles')|list }}"
loop_control:
loop_var: item_role
when: "'roles' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags:
- roles
- name: "Processing user roles resources for profile {{ item_profile }}"
include: create_user_role.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='user_roles')|list }}"
loop_control:
loop_var: item_user_role
when: "'user_roles' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags:
- user_roles
- name: "Processing quotas resources for profile {{ item_profile }}"
include: create_quota.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='quotas')|list }}"
loop_control:
loop_var: item_quota
when: "'quotas' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags:
- quotas
- name: "Processing networks resources for profile {{ item_profile }}"
include: create_network.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='networks')|list }}"
loop_control:
loop_var: item_network
when: "'networks' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags:
- networks
- name: "Processing subnets resources for profile {{ item_profile }}"
include: create_subnet.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='subnets')|list }}"
loop_control:
loop_var: item_subnet
when: "'subnets' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags:
- subnets
- name: "Processing routers resources for profile {{ item_profile }}"
include: create_router.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='routers')|list }}"
loop_control:
loop_var: item_router
when: "'routers' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags:
- routers
- name: "Processing flavors resources for profile {{ item_profile }}"
include: create_flavor.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='flavors')|list }}"
loop_control:
loop_var: item_flavor
when: "'flavors' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags:
- flavors
- name: "Processing images resources for profile {{ item_profile }}"
include: create_image.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='images')|list }}"
loop_control:
loop_var: item_image
when: "'images' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags:
- images
- name: "Processing security_groups resources for profile {{ item_profile }}"
include: create_security_group.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='security_groups')|list }}"
loop_control:
loop_var: item_security_group
when: "'security_groups' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags:
- security_groups
- name: "Processing security_groups_rules resources for profile {{ item_profile }}"
include: create_security_group_rule.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='security_groups_rules')|list }}"
loop_control:
loop_var: item_security_group_rule
when: "'security_groups_rules' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags:
- security_groups_rules
- name: "Processing keypairs resources for profile {{ item_profile }}"
include: create_keypair.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='keypairs')|list }}"
loop_control:
loop_var: item_keypair
when: "'keypairs' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags:
- keypairs
- name: "Processing volumes resources for profile {{ item_profile }}"
include: create_volume.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='volumes')|list }}"
loop_control:
loop_var: item_volume
when: "'volumes' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags:
- volumes
- name: "Processing servers resources for profile {{ item_profile }}"
include: create_server.yml
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='servers')|list }}"
loop_control:
loop_var: item_server
when: "'servers' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags:
- servers