Loop to Print same name multiple times

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

Hi
There is sequence and count loops . Look at here

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

//Vinoth