Make system_crontab_coordination idempotent

Use a seed in the system_crontab_coordination role template's random
filter so that each host's results are idempotent when re-running.
This prevents the constant changing of the crontab whenever the
playbook is run.

Change-Id: I283f7562adf5984498ad712cf030bbb21a0e6a9c
This commit is contained in:
Jimmy McCrory 2018-10-18 10:30:56 -07:00 committed by Jesse Pretorius (odyssey4me)
parent 4b1635d477
commit 953938a29d
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
{%- if ((hosts | length) | int) > (period | int) -%}
0
{%- else -%}
{{ (((period | int) / ((hosts | length) | int)) | int) | random }}
{{ (((period | int) / ((hosts | length) | int)) | int) | random(seed=inventory_hostname) }}
{%- endif -%}
{%- endmacro %}
{% for host in ansible_play_hosts %}