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.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5e307694-510f-4ece-b877-8788ecf153a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Dick Davies at Dec 15, 2014 at 11:00 am
    How about hashing their hostnames, or using something else unique but constant
    about them (last octet of their IP, maybe)?
    On 14 December 2014 at 19:14, iprok wrote:
    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.

    --
    You received this message because you are subscribed to the Google Groups
    "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/ansible-project/5e307694-510f-4ece-b877-8788ecf153a8%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAK5eLPSZ0m73WCTvohFFOJwOq%3DjOCDRR-M6p02ny0xZkbeNjJg%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Brian Coca at Dec 15, 2014 at 2:23 pm
    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

    --
    You received this message because you are subscribed to the Google Groups "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAJ5XC8kWLjF0ttXeaAqvEo-Qf-_iLmZG00fgDmTeqS%2B%3DtwbX6w%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Iprok at Dec 15, 2014 at 2:26 pm
    понедельник, 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?

    --
    You received this message because you are subscribed to the Google Groups "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/ba5d4ea7-f79d-4a90-bb51-baa69def5eaf%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Brian Coca at Dec 15, 2014 at 3:35 pm
    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



    --
    Brian Coca

    --
    You received this message because you are subscribed to the Google Groups "Ansible Project" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAJ5XC8kcySaxWDKCMsuyvuazWvtECf59iR8f%2B5_yXpK3%2Bj3JkA%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupansible-project @
postedDec 14, '14 at 7:42p
activeDec 15, '14 at 3:35p
posts5
users3

3 users in discussion

Brian Coca: 2 posts Iprok: 2 posts Dick Davies: 1 post

People

Translate

site design / logo © 2022 Grokbase