1
0
Fork 0
mirror of https://gitlab.com/s3lph/ansible-collection-dirvish synced 2024-11-15 05:44:15 +01:00
ansible-collection-dirvish/roles/dirvish_server/templates/dirvish.crontab.j2

16 lines
874 B
Text
Raw Normal View History

2020-10-31 04:34:41 +01:00
{{ 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 %}