Hi
There is sequence and count loops . Look at here

https://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html#with-sequence

//Vinoth
On Sun 30. May 2021 at 18:52, R.B. Kumar <[email protected]> wrote:

> Hello Everyone - I am aware we can use *with_items *and *loop *methods to
> create a iterative loops in Ansible. Is there a logic to use kind of "for
> loops"
>
> For example, i want to execute one Cisco command in the same Router
> continuously for 10 times .. How to do this in Ansible? i am looking some
> thing like " range" command in python
>
> Currently i use hard way of manually entering the command  multiple times
>
> - name: clear session
>   ios_commands:
>     commands:
>         - clear counters
>         - clear counters
>         - clear counters
>         - clear counters
>
> regards,RB
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/49ff0af7-f164-4ce7-bc80-202afc51725an%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/49ff0af7-f164-4ce7-bc80-202afc51725an%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAJ%2BRxtQ3bxNFkF5HTKcayohG%3DBwe2LWWrHkbUgjURVvwWbT%3D%2BA%40mail.gmail.com.

Reply via email to