1
0
Fork 0
mirror of https://gitlab.com/s3lph/ansible-collection-dirvish synced 2024-11-14 05:14:15 +01:00
ansible-collection-dirvish/roles/dirvish_server/templates/dirvish.crontab.j2
2020-10-31 04:34:41 +01:00

16 lines
No EOL
874 B
Django/Jinja

{{ ansible_managed | comment }}
SHELL=/bin/sh
{%- set hosts = [] -%}
{%- for host in hostvars.keys() -%}
{%- if dirvish_server_clients_group in hostvars[host].group_names -%}
{%- set _ = hosts.append(host) -%}
{%- endif -%}
{%- endfor %}
{% for host in hosts %}
{%- set t = dirvish_server_cronjob_minute_initial + dirvish_server_cronjob_step_minutes * loop.index0 -%}
{%- set m = t % 60 -%}
{%- set h = ( dirvish_server_cronjob_hour_initial + ((t/60)|int) ) % 24 -%}
{{ '% 2s'|format(m) }} {{ '% 2s'|format(h) }} {{ '% 2s'|format(dirvish_server_cronjob_dom) }} {{ '% 2s'|format(dirvish_server_cronjob_month) }} {{ '% 2s'|format(dirvish_server_cronjob_dow) }} root /usr/local/bin/dirvish-expire-configfile --config {{ dirvish_server_master_conf }} --vault {{ host }} --quiet && /usr/sbin/dirvish --config {{ dirvish_server_master_conf }} --vault {{ host }}
{% endfor %}