Initial commit
This commit is contained in:
commit
42f4a74218
18
meta/main.yml
Normal file
18
meta/main.yml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
dependencies: []
|
||||||
|
|
||||||
|
galaxy_info:
|
||||||
|
role_name: backup-things
|
||||||
|
author: 'Pierre-Olivier Mercier <nemunaire+iac@nemunai.re>'
|
||||||
|
description: Backup things
|
||||||
|
license: GPL-3.0-or-later
|
||||||
|
min_ansible_version: 2.9
|
||||||
|
platforms:
|
||||||
|
- name: Alpine
|
||||||
|
versions:
|
||||||
|
- all
|
||||||
|
- name: Debian
|
||||||
|
versions:
|
||||||
|
- all
|
||||||
|
galaxy_tags: []
|
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…
x
Reference in New Issue
Block a user