Compare commits
1
Commits
1d415bfae8
...
c362460b86
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c362460b86 |
No files matched your search
@@ -3,6 +3,7 @@
|
|||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name: restic
|
name: restic
|
||||||
state: present
|
state: present
|
||||||
|
update_cache: true
|
||||||
|
|
||||||
- name: Initialize restic repository
|
- name: Initialize restic repository
|
||||||
environment:
|
environment:
|
||||||
@@ -11,11 +12,11 @@
|
|||||||
AWS_ACCESS_KEY_ID: "{{ vault_aws_access_key }}"
|
AWS_ACCESS_KEY_ID: "{{ vault_aws_access_key }}"
|
||||||
AWS_SECRET_ACCESS_KEY: "{{ vault_aws_secret_key }}"
|
AWS_SECRET_ACCESS_KEY: "{{ vault_aws_secret_key }}"
|
||||||
block:
|
block:
|
||||||
- name: Check if already initialized
|
- name: Check if repository is initialized
|
||||||
ansible.builtin.command: restic snapshots
|
command: restic cat config
|
||||||
register: restic_check
|
register: restic_check
|
||||||
failed_when: false
|
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
failed_when: false
|
||||||
|
|
||||||
- name: Initialize repository
|
- name: Initialize repository
|
||||||
ansible.builtin.command: restic init
|
ansible.builtin.command: restic init
|
||||||
|
|||||||
@@ -3,11 +3,7 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Source environment variables if running manually/outside Systemd
|
## Environment is injected by the systemd unit via EnvironmentFile=/etc/restic-backup.env. Run manually with: systemctl start restic-backup.service
|
||||||
if [ -f /etc/restic-backup.env ]; then
|
|
||||||
# shellcheck source=/dev/null
|
|
||||||
. /etc/restic-backup.env
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Starting Restic Backup at $(date)"
|
echo "Starting Restic Backup at $(date)"
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user