Initial commit
This commit is contained in:
commit
42f4a74218
2 changed files with 37 additions and 0 deletions
19
tasks/main.yml
Normal file
19
tasks/main.yml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
---
|
||||
- name: Install restic
|
||||
apk:
|
||||
name:
|
||||
- restic
|
||||
|
||||
- name: setup backup throught cron
|
||||
ansible.builtin.copy:
|
||||
content: |
|
||||
#!/bin/sh
|
||||
export AWS_ACCESS_KEY_ID={{ restic_aws_access_key_id | to_json }}
|
||||
export AWS_SECRET_ACCESS_KEY={{ restic_aws_secret_access_key | to_json }}
|
||||
|
||||
export RESTIC_REPOSITORY="s3:{{ restic_aws_endpoint }}/{{ restic_aws_bucket_name }}"
|
||||
export RESTIC_PASSWORD={{ restic_password | to_json }}
|
||||
|
||||
restic backup {{ restic_directory }}
|
||||
dest: "/etc/periodic/daily/backup_{{ ansible_play_name | replace(' ', '_') }}"
|
||||
mode: 0755
|
||||
Loading…
Add table
Add a link
Reference in a new issue