My question is when I run this code I get expected out where the loop get executed 3 times.
However I want to put these 3 statements in a loop such as
-“{{ vardata.L2.[some variable]}}”
and increment counter until the condition is met which is 3 times if I have 3 elements in list , 10 times if I have 10 elements in list.
However when I do this this get executed only once and no way I can find to increment the counter and run the loop multiple times.
Not sure what will be the syntax for the variable inside the loop
Any body can help.
I have following code to call another file find_elements.yaml from my current playbook.
calling from my current playbook
- include: find_elements.yaml
loop:
-"{{ vardata.L2.0 }}"
-"{{ vardata.L2.1 }}"
--"{{ vardata.L2.1 }}"
loop_control:
loop_var: testing
My question is when I run this code I get expected out where the loop get executed 3 times.
However I want to put these 3 statements in a loop such as
-"{{ vardata.L2.[some variable]}}"
and increment counter until the condition is met which is 3 times if I have 3 elements in list , 10 times if I have 10
elements in list.
However when I do this this get executed only once and no way I can find to increment the counter and run the loop
multiple times.
Not sure what will be the syntax for the variable inside the loop
Any body can help.
What about sharing the real playbook and explain why you need this loop setup? So far I can not see
the logic in your example and your description.
So i have excel file from where I am reading the file and populating the variables files called iterate.yaml which puts it in dictionary of list with each excel row values as a list of elements
So i have excel file from where I am reading the file and populating the variables files called iterate.yaml which puts
it in dictionary of list with each excel row values as a list of elements