Add borg
This commit is contained in:
parent
31744304a1
commit
18ef613556
7 changed files with 33 additions and 0 deletions
13
roles/borg/tasks/base.yml
Normal file
13
roles/borg/tasks/base.yml
Normal file
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
|
||||
- name: Copy template conf
|
||||
ansible.builtin.template:
|
||||
backup: true
|
||||
src: "{{ item.src }}"
|
||||
dest: "/usr/bin/{{ item.dest }}"
|
||||
group: root
|
||||
owner: root
|
||||
mode: u=rwx,g=rx,o=rx
|
||||
loop:
|
||||
- { src: 'backup.j2', dest: 'backup' }
|
||||
become: true
|
8
roles/borg/tasks/cron.yml
Normal file
8
roles/borg/tasks/cron.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
|
||||
- name: Ensure a job that run to backup data
|
||||
ansible.builtin.cron:
|
||||
name: "borg backup"
|
||||
special_time: "daily"
|
||||
job: "/usr/bin/backup"
|
||||
become: yes
|
7
roles/borg/tasks/main.yml
Normal file
7
roles/borg/tasks/main.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
|
||||
- ansible.builtin.import_tasks: base.yml
|
||||
name: base
|
||||
|
||||
- ansible.builtin.import_tasks: cron.yml
|
||||
name: cron
|
Loading…
Add table
Add a link
Reference in a new issue