1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #4203 from candeira/with_nested

fix documentation examples for with_nested
This commit is contained in:
James Cammarata 2013-09-22 06:58:42 -07:00
commit 0ebc29d3d4

View file

@ -500,15 +500,15 @@ Nested Loops
Loops can be nested as well:: Loops can be nested as well::
- name: give users access to multiple databases - name: give users access to multiple databases
mysql_user: name={{ item[0] }} priv={{ item[1] }}.*:* mysql_user: name={{ item[0] }} priv={{ item[1] }}.*:ALL password=foo
with_nested: with_nested:
- [ 'alice', 'bob', 'eve' ] - [ 'alice', 'bob', 'eve' ]
- [ 'clientdb', 'employeedb', 'providerdb' ] - [ 'clientdb', 'employeedb', 'providerdb' ]
As with the case of 'with_items' above, you can use previously defined variables. Just specify the variable'sname without templating it with '{{ }}':: As with the case of 'with_items' above, you can use previously defined variables. Just specify the variable's name without templating it with '{{ }}'::
- name: here, 'users' contains the above list of employees - name: here, 'users' contains the above list of employees
mysql_user: name={{ item[0] }} priv={{ item[1] }}.*:* mysql_user: name={{ item[0] }} priv={{ item[1] }}.*:ALL password=foo
with_nested: with_nested:
- users - users
- [ 'clientdb', 'employeedb', 'providerdb' ] - [ 'clientdb', 'employeedb', 'providerdb' ]