Clarify that index_var is 0 indexed (#70548)
A little further down the page is another index, ansible_loop.index, which shares a similar description but is 1 indexed. Its zero indexed twin has a 0 suffix. ``ansible_loop.index`` The current iteration of the loop. (1 indexed) ``ansible_loop.index0`` The current iteration of the loop. (0 indexed) To remove ambiguity around the usage of index_var, explicitly mention that this variable is 0 indexed.
This commit is contained in:
parent
f4ea43c4a0
commit
c410311f55
1 changed files with 2 additions and 0 deletions
|
@ -352,6 +352,8 @@ To keep track of where you are in a loop, use the ``index_var`` directive with `
|
|||
loop_control:
|
||||
index_var: my_idx
|
||||
|
||||
.. note:: `index_var` is 0 indexed.
|
||||
|
||||
Defining inner and outer variable names with ``loop_var``
|
||||
---------------------------------------------------------
|
||||
.. versionadded:: 2.1
|
||||
|
|
Loading…
Reference in a new issue