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
This commit is contained in:
Clark Boylan 2018-09-06 13:52:09 -07:00
parent 126a547f04
commit 472065fb05

View File

@ -4,7 +4,7 @@
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='domains')|list }}" with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='domains')|list }}"
loop_control: loop_control:
loop_var: item_domain loop_var: item_domain
when: "{{ 'domains' in profiles|selectattr('name', 'equalto', item_profile)|list|first }}" when: "'domains' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags: tags:
- domains - domains
@ -13,7 +13,7 @@
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='projects')|list }}" with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='projects')|list }}"
loop_control: loop_control:
loop_var: item_project loop_var: item_project
when: "{{ 'projects' in profiles|selectattr('name', 'equalto', item_profile)|list|first }}" when: "'projects' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags: tags:
- projects - projects
@ -22,7 +22,7 @@
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='users')|list }}" with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='users')|list }}"
loop_control: loop_control:
loop_var: item_user loop_var: item_user
when: "{{ 'users' in profiles|selectattr('name', 'equalto', item_profile)|list|first }}" when: "'users' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags: tags:
- users - users
@ -31,7 +31,7 @@
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='roles')|list }}" with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='roles')|list }}"
loop_control: loop_control:
loop_var: item_role loop_var: item_role
when: "{{ 'roles' in profiles|selectattr('name', 'equalto', item_profile)|list|first }}" when: "'roles' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags: tags:
- roles - roles
@ -40,7 +40,7 @@
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='user_roles')|list }}" with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='user_roles')|list }}"
loop_control: loop_control:
loop_var: item_user_role loop_var: item_user_role
when: "{{ 'user_roles' in profiles|selectattr('name', 'equalto', item_profile)|list|first }}" when: "'user_roles' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags: tags:
- user_roles - user_roles
@ -49,7 +49,7 @@
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='quotas')|list }}" with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='quotas')|list }}"
loop_control: loop_control:
loop_var: item_quota loop_var: item_quota
when: "{{ 'quotas' in profiles|selectattr('name', 'equalto', item_profile)|list|first }}" when: "'quotas' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags: tags:
- quotas - quotas
@ -58,7 +58,7 @@
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='networks')|list }}" with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='networks')|list }}"
loop_control: loop_control:
loop_var: item_network loop_var: item_network
when: "{{ 'networks' in profiles|selectattr('name', 'equalto', item_profile)|list|first }}" when: "'networks' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags: tags:
- networks - networks
@ -67,7 +67,7 @@
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='subnets')|list }}" with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='subnets')|list }}"
loop_control: loop_control:
loop_var: item_subnet loop_var: item_subnet
when: "{{ 'subnets' in profiles|selectattr('name', 'equalto', item_profile)|list|first }}" when: "'subnets' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags: tags:
- subnets - subnets
@ -76,7 +76,7 @@
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='routers')|list }}" with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='routers')|list }}"
loop_control: loop_control:
loop_var: item_router loop_var: item_router
when: "{{ 'routers' in profiles|selectattr('name', 'equalto', item_profile)|list|first }}" when: "'routers' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags: tags:
- routers - routers
@ -85,7 +85,7 @@
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='flavors')|list }}" with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='flavors')|list }}"
loop_control: loop_control:
loop_var: item_flavor loop_var: item_flavor
when: "{{ 'flavors' in profiles|selectattr('name', 'equalto', item_profile)|list|first }}" when: "'flavors' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags: tags:
- flavors - flavors
@ -94,7 +94,7 @@
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='images')|list }}" with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='images')|list }}"
loop_control: loop_control:
loop_var: item_image loop_var: item_image
when: "{{ 'images' in profiles|selectattr('name', 'equalto', item_profile)|list|first }}" when: "'images' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags: tags:
- images - images
@ -103,7 +103,7 @@
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='security_groups')|list }}" with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='security_groups')|list }}"
loop_control: loop_control:
loop_var: item_security_group loop_var: item_security_group
when: "{{ 'security_groups' in profiles|selectattr('name', 'equalto', item_profile)|list|first }}" when: "'security_groups' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags: tags:
- security_groups - security_groups
@ -112,7 +112,7 @@
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='security_groups_rules')|list }}" with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='security_groups_rules')|list }}"
loop_control: loop_control:
loop_var: item_security_group_rule loop_var: item_security_group_rule
when: "{{ 'security_groups_rules' in profiles|selectattr('name', 'equalto', item_profile)|list|first }}" when: "'security_groups_rules' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags: tags:
- security_groups_rules - security_groups_rules
@ -121,7 +121,7 @@
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='keypairs')|list }}" with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='keypairs')|list }}"
loop_control: loop_control:
loop_var: item_keypair loop_var: item_keypair
when: "{{ 'keypairs' in profiles|selectattr('name', 'equalto', item_profile)|list|first }}" when: "'keypairs' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags: tags:
- keypairs - keypairs
@ -130,7 +130,7 @@
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='volumes')|list }}" with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='volumes')|list }}"
loop_control: loop_control:
loop_var: item_volume loop_var: item_volume
when: "{{ 'volumes' in profiles|selectattr('name', 'equalto', item_profile)|list|first }}" when: "'volumes' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags: tags:
- volumes - volumes
@ -139,6 +139,6 @@
with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='servers')|list }}" with_items: "{{ profiles|selectattr('name', 'equalto', item_profile)|map(attribute='servers')|list }}"
loop_control: loop_control:
loop_var: item_server loop_var: item_server
when: "{{ 'servers' in profiles|selectattr('name', 'equalto', item_profile)|list|first }}" when: "'servers' in profiles|selectattr('name', 'equalto', item_profile)|list|first"
tags: tags:
- servers - servers