You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
Hello!
I want to add back up task of my databases to cron. I don't want them to start at the same time. And I have too much hosts to initialize each of them using variables. But if I use random filter it becomes unidempotent. Is it any way how to do what I want keeping idempotency?
Thank you.
Dick Davies
unread,
Dec 15, 2014, 6:00:25 AM12/15/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible list
How about hashing their hostnames, or using something else unique but constant
about them (last octet of their IP, maybe)?
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
I've used the random filter to conditionally create either host_vars
with the value (if file exists it doesn't regenerate), optionally you
could create a file on the target in /etc/ansible/facts.d/
Another option would be to create something similar to the password
lookup, a db backed random lookup.
--
Brian Coca
iprok
unread,
Dec 15, 2014, 9:26:00 AM12/15/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
понедельник, 15 декабря 2014 г., 17:23:30 UTC+3 пользователь Brian Coca написал:
I've used the random filter to conditionally create either host_vars
with the value (if file exists it doesn't regenerate)
Sounds interesting. How have you done this?
Brian Coca
unread,
Dec 15, 2014, 10:35:25 AM12/15/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
example (i prefer template but this makes it a 1 liner):
- copy: content="[defaults]\ntime={{60|random}}"
dest=/etc/facts.d/mycronscript.facts
when: ansible_local is not defined or 'mycronscript' in
ansible_local or 'time' not in ansible_local.mycronscripts