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:
parent
4b1635d477
commit
953938a29d
@ -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 %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user