From 25780828cca87d1d380949470d47073fae3d9e02 Mon Sep 17 00:00:00 2001 From: vincent Date: Sat, 23 Dec 2023 20:51:05 +0100 Subject: [PATCH] job: add borgmatic --- nomad-job/borgmatic.nomad | 219 ++++++++++++++++++++++++++++++++++++++ terraform/vault/nomad.tf | 3 +- 2 files changed, 221 insertions(+), 1 deletion(-) create mode 100644 nomad-job/borgmatic.nomad diff --git a/nomad-job/borgmatic.nomad b/nomad-job/borgmatic.nomad new file mode 100644 index 0000000..40c5027 --- /dev/null +++ b/nomad-job/borgmatic.nomad @@ -0,0 +1,219 @@ + +job "borgmatic" { + datacenters = ["homelab"] + priority = 50 + type = "service" + meta { + forcedeploy = "0" + } + constraint { + attribute = "${node.class}" + operator = "set_contains" + value = "NAS" + } + + group "borgmatic"{ + vault{ + policies= ["borgmatic"] + + } + task "borgmatic" { + driver = "docker" + config { + image = "ghcr.io/borgmatic-collective/borgmatic" + volumes = [ + "/var/local/volume1:/var/local/volume1", + "local/borgmatic.d:/etc/borgmatic.d", + "secret/id_rsa:/root/.ssh/id_rsa", + "/mnt/diskstation/nomad/borgmatic:/root/.cache/borg", + ] + + } + env { + } + + template { + data= <