1

I have an Ansible project with more or less 100 hosts (much more in a near future), this project does several calls to an API that as a limit rate of 1000 calls per token.

In my project I define the token on group_vars and what I want is to run a task and have the token changed every 20 hosts, like the first 20 hosts would have the group_var token=A, the next 20 hosts would have the group_var token=B, etc ...

Is there any way to do this ? I took a look on loop docs but it seems that all loops are meant to run multiple variables on each host and that's quite the opposite of what I'm trying to achieve.

0 Answers0