change to a more easy-to-understand example (#15863)

This commit is contained in:
toromoti 2016-05-16 22:48:54 +09:00 committed by Brian Coca
parent 10edaabed5
commit 11b3a1b8ce

View file

@ -556,7 +556,7 @@ Ansible by default sets the loop variable `item` for each loop, which causes the
As of Ansible 2.1, the `loop_control` option can be used to specify the name of the variable to be used for the loop::
# main.yml
- include: test.yml outer_loop="{{ outer_item }}"
- include: inner.yml
with_items:
- 1
- 2
@ -565,7 +565,7 @@ As of Ansible 2.1, the `loop_control` option can be used to specify the name of
loop_var: outer_item
# inner.yml
- debug: msg="outer item={{ outer_loop }} inner item={{ item }}"
- debug: msg="outer item={{ outer_item }} inner item={{ item }}"
with_items:
- a
- b
@ -583,7 +583,7 @@ Because `loop_control` is not available in Ansible 2.0, when using an include wi
for `item`::
# main.yml
- include: test.yml
- include: inner.yml
with_items:
- 1
- 2