Add a pre_command to kopia_backup for host dump scripts and install gpg for the apt key
This commit is contained in:
@@ -15,6 +15,8 @@ kopia_backup:
|
|||||||
sources: []
|
sources: []
|
||||||
# source path -> ignore rules, replacing the policy rules on every run (null drops one).
|
# source path -> ignore rules, replacing the policy rules on every run (null drops one).
|
||||||
ignore: {}
|
ignore: {}
|
||||||
|
# Command run first, e.g. a host script writing dumps into a source; a failure fails the run, the snapshot still runs.
|
||||||
|
pre_command: ""
|
||||||
# Database dumps written to /var/backups/dumps before the snapshot, which then includes that directory.
|
# Database dumps written to /var/backups/dumps before the snapshot, which then includes that directory.
|
||||||
# Each item: file, container, command (run with sh -c inside the container, output is the dump).
|
# Each item: file, container, command (run with sh -c inside the container, output is the dump).
|
||||||
dumps: []
|
dumps: []
|
||||||
|
|||||||
@@ -15,6 +15,11 @@
|
|||||||
state: directory
|
state: directory
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
|
||||||
|
- name: Install gpg for the apt key
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name: gpg
|
||||||
|
state: present
|
||||||
|
|
||||||
- name: Add the Kopia apt key
|
- name: Add the Kopia apt key
|
||||||
ansible.builtin.shell: curl -fsSL https://kopia.io/signing-key | gpg --dearmor -o /etc/apt/keyrings/kopia-keyring.gpg
|
ansible.builtin.shell: curl -fsSL https://kopia.io/signing-key | gpg --dearmor -o /etc/apt/keyrings/kopia-keyring.gpg
|
||||||
args:
|
args:
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ set -uo pipefail
|
|||||||
export KOPIA_CHECK_FOR_UPDATES=false
|
export KOPIA_CHECK_FOR_UPDATES=false
|
||||||
failed=0
|
failed=0
|
||||||
sources=()
|
sources=()
|
||||||
|
{% if kopia_backup.pre_command %}
|
||||||
|
|
||||||
|
{{ kopia_backup.pre_command }} || { echo "pre_command failed" >&2; failed=1; }
|
||||||
|
{% endif %}
|
||||||
{% if kopia_backup.etcd_snapshot %}
|
{% if kopia_backup.etcd_snapshot %}
|
||||||
|
|
||||||
# Only the latest etcd snapshot; the live etcd dir is not consistent on disk and older snapshots only add churn
|
# Only the latest etcd snapshot; the live etcd dir is not consistent on disk and older snapshots only add churn
|
||||||
|
|||||||
Reference in New Issue
Block a user