20 lines
597 B
YAML
20 lines
597 B
YAML
---
|
|
- 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
|