diff --git a/ansible/host_vars/oscar b/ansible/host_vars/oscar index a88c9fc..553c716 100644 --- a/ansible/host_vars/oscar +++ b/ansible/host_vars/oscar @@ -17,8 +17,6 @@ wireguard_postdown: - iptables -t nat -D POSTROUTING -o enp2s0 -j MASQUERADE consul_snapshot: True -vault_snapshot: true -vault_backup_location: "/mnt/diskstation/git/backup/vault" partition_table: - device: "/dev/sda" label: gpt diff --git a/ansible/host_vars/oscar-dev b/ansible/host_vars/oscar-dev index d4edca3..225bc63 100644 --- a/ansible/host_vars/oscar-dev +++ b/ansible/host_vars/oscar-dev @@ -13,5 +13,3 @@ wireguard_postdown: - iptables -D FORWARD -o wg0 -j ACCEPT - iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE consul_snapshot: True -vault_snapshot: True -vault_backup_location: "/mnt/diskstation/git/backup/vault" diff --git a/nomad-job/vault-backup.nomad b/nomad-job/vault-backup.nomad new file mode 100644 index 0000000..5859ae8 --- /dev/null +++ b/nomad-job/vault-backup.nomad @@ -0,0 +1,49 @@ + +job "vault-backup" { + datacenters = ["homelab"] + priority = 50 + type = "batch" + meta { + forcedeploy = "0" + } + + constraint { + attribute = "${attr.cpu.arch}" + value = "amd64" + } + periodic { + crons = ["30 3 * * *"] + prohibit_overlap = true + } + group "vault-backup" { + network { + mode = "host" + } + vault { + policies = ["vault-backup"] + } + task "vault-backup" { + driver = "docker" + config { + image = "ducampsv/docker-vault-backup:latest" + volumes = [ + "/mnt/diskstation/git/backup/vault:/backup" + ] + } + template { + data = <