Hi list,
Is there a way to have a counter with the with_items loop ?
The idea would be to create several cron job not starting all at the same time.
tasks:
- name: “Install some cron jobs”
cron: name=“job {{ item }}” min=“COUNTER??” hour=“3” user=root cron_file=“myjobs” job=“/path/to/some/script {{ item }}”
with_items: somelist
the result could look like so:
#Ansible: job item1
1 3 * * * root /path/to/some/script item1
#Ansible: job item2
2 3 * * * root /path/to/some/script item2
#Ansible: job item3
3 3 * * * root /path/to/some/script item3
any suggesstions ?
Many thanks,
Julien.