-
Notifications
You must be signed in to change notification settings - Fork 23.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CRON module] add support for random minutes/hours. #6896
Comments
The proposal that has been made in the past is something like {{ foo | random_int }} which I think would be great as a filter to add to core.py. Is this something you would like to work on? Previously there was an implementation attempt but it was way too complicated in terms of syntax, and I'd definitely accept a core.py filter looking something like the above. |
sorry I'm not a python coder, so cant help with official implementations. but would love to test proposed solution for this above issue. |
filter added in #6917 should give you that |
@bcoca Idempotence is an issue here? If you use the random filter, your going to get a new random number every time you run the play. I think the capability has to be bulit into the cron module. Something like |
@sam yes, that is why i use random numbers to assign them to a host var, The random filter has other uses, I use it to choose a random node in a |
@bcoca OK. In fact a decent way to handle this is to derive an integer from the cron job's name and get the appropriate modulus. There seems to be lack of inbuilt filters to do this though. Adding an |
Summary; |
It will be great when number 5 "The issue of idempotence is not addressed directly yet." is done. |
Hi! Thanks very much for your interest in Ansible. It sincerely means a lot to us. On September 26, 2014, due to enormous levels of contribution to the project Ansible decided to reorganize module repos, making it easier We split modules from the main project off into two repos, http://github.com/ansible/ansible-modules-core and http://github.com/ansible/ansible-modules-extras If you would still like this ticket attended to, and believe this problem or idea is still present in the latest version of Ansible (1.7.2) or the development branch, we will need your help in having it reopened in one of the two new repos, and instructions are provided below. We apologize that we are not able to make this transition happen seamlessly, though this is a one-time change and your help is greatly appreciated -- Both sets of modules will ship with Ansible, though they'll receive slightly different ticket handling. To locate where a module lives between 'core' and 'extras'
Additionally, should you need more help with this, you can ask questions on:
Thank you very much! |
@photoninger , per my investigation, the idempotency was actually neatly solved with this July 8 , 2013 code, viewing blame on;
Thus this ticket does not need to be ported to Core. I noted as such in ; |
Issue Type:
Feature Idea
Ansible Version:
ansible 1.5.4
Environment:
Debian 7
Summary:
Today I use bash to automate simple tasks and would like to go over to ansible
I use this below to get a random minute for my cronjob (so not all mysqldumps begins at the same exact time on my vps servers which share hardware, it would create a pretty big load)
II would love to be able to have this functionality in the CRON module. and not first create a random number variable in bash and import it as a variable to my playbook. Its a few extra steps.
Steps To Reproduce:
random time is not added to CRON module
Expected Results:
add random generator to the module
Actual Results:
random time is not added to CRON module
The text was updated successfully, but these errors were encountered: