mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
allow references to names of variables in with_items without needing to surround them with Jinja2 '{{' delimeters
This commit is contained in:
@@ -7,16 +7,25 @@
|
||||
|
||||
- hosts: all
|
||||
|
||||
tasks:
|
||||
- shell: echo 'hello {{ ansible_hostname.upper() }}'
|
||||
vars:
|
||||
a_list:
|
||||
- a
|
||||
- b
|
||||
- c
|
||||
|
||||
- shell: echo 'match'
|
||||
tasks:
|
||||
- shell: echo hello {{ ansible_hostname.upper() }}
|
||||
|
||||
- shell: echo match
|
||||
when: 2 == 2
|
||||
|
||||
- shell: echo 'no match'
|
||||
- shell: echo no match
|
||||
when: 2 == 2 + 1
|
||||
|
||||
- shell: echo '{{ ansible_os_family }}'
|
||||
- shell: echo {{ ansible_os_family }}
|
||||
|
||||
- shell: echo {{ item }}
|
||||
with_items: a_list
|
||||
|
||||
- shell: echo 'RedHat'
|
||||
when: ansible_os_family == 'RedHat'
|
||||
|
||||
Reference in New Issue
Block a user