add more restic helper scripts

This commit is contained in:
2019-12-18 22:09:05 -06:00
parent 0eb5699a8d
commit 8ab9c36366
7 changed files with 198 additions and 121 deletions

View File

@ -65,21 +65,17 @@
- "{{ restic_etc_path }}/repos"
- "{{ restic_etc_path }}/jobs"
- name: create restic job wrapper script
template:
src: restic-job.sh.j2
dest: "{{ restic_bin_path }}/restic-job"
owner: root
group: root
mode: 0755
- name: create restic tidy wrapper
template:
src: restic-tidy.sh.j2
dest: "{{ restic_bin_path }}/restic-tidy"
- name: copy restic helper scripts
copy:
src: "{{ item }}"
dest: "{{ restic_bin_path }}/{{ item | basename | splitext | first }}"
owner: root
group: root
mode: 0755
loop:
- restic-tidy.sh
- restic-repo.sh
- restic-job.sh
- name: manage repos
include: repo.yaml

View File

@ -36,6 +36,23 @@
group: root
mode: 0400
- name: symlink default repo
block:
- name: explicit default
file:
src: "{{ restic_etc_path }}/repos/{{ item.name }}"
dest: "{{ restic_etc_path }}/repos/default"
state: link
force: yes
when: item.default is defined and item.default == True
- name: implicit default
file:
src: "{{ restic_etc_path }}/repos/{{ item.name }}"
dest: "{{ restic_etc_path }}/repos/default"
state: link
force: yes
when: restic_repos | count == 1
- name: create cron
cron:
name: "restic {{ item.name }} tidy"