ansible_role_restic/tasks/distribution/Linux.yml
Matthias Leutenegger 6257b6ae1c lint
2019-08-15 14:51:42 +02:00

33 lines
1,001 B
YAML

---
# tasks file for skeleton
- name: Create backup script
template:
src: restic_script_Linux.j2
dest: '{{ restic_script_dir }}/backup-{{ item.name }}.sh'
mode: '0700'
owner: '{{ restic_dir_owner }}'
group: '{{ restic_dir_group }}'
no_log: true
with_items: '{{ restic_backups }}'
when:
- item.name is defined
- item.src is defined or item.stdin is defined
- item.src is defined or item.stdin and item.stdin_cmd is defined
- item.repo in restic_repos
- name: Setup CRON jobs
cron:
name: 'arillso.restic backup {{ item.name }}'
job: 'CRON=true {{ restic_script_dir }}/backup-{{ item.name }}.sh'
minute: '{{ schedule_minute | default("*") }}'
hour: '{{ schedule_hour | default("*") }}'
weekday: '{{ schedule_weekday | default("*") }}'
month: '{{ schedule_month | default("*") }}'
state: present
become: true
when:
- restic_create_cron
- item.name is defined
- item.scheduled
with_items: '{{ restic_backups }}'