nomad

HCL and Docker files for Nomad deployments
git clone https://git.in0rdr.ch/nomad.git
Log | Files | Refs | Pull requests |Archive

commit e7beb0ce2d38cd0f99a2b674816b2cfd7cee045e
parent 763c31b1d765eda0a20f1d5616199b61b1eea110
Author: Andreas Gruhler <agruhl@gmx.ch>
Date:   Thu, 21 Aug 2025 19:47:05 +0200

feat(hortusfox): add backup and recurring cronjobs

Diffstat:
Ahcl/default/hortus-fox/hortusfox-cronjobs.nomad | 68++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 68 insertions(+), 0 deletions(-)

diff --git a/hcl/default/hortus-fox/hortusfox-cronjobs.nomad b/hcl/default/hortus-fox/hortusfox-cronjobs.nomad @@ -0,0 +1,68 @@ +# https://github.com/danielbrendel/hortusfox-web?tab=readme-ov-file#cronjobs + +job "hortusfox-cronjobs" { + datacenters = ["dc1"] + type = "batch" + + vault {} + + periodic { + crons = [ + "@hourly" + ] + } + + group "cron" { + count = 1 + + task "recurring" { + driver = "podman" + + config { + image = "docker.io/curlimages/curl:latest" + entrypoint = [""] + command = "/bin/sh" + args = ["-c", "curl -v https://plants.in0rdr.ch/cronjob/tasks/recurring?cronpw=$CRONPW"] + } + + template { + env = true + destination = "${NOMAD_SECRETS_DIR}/env" + data = <<EOT +CRONPW = "{{with secret "kv/hortusfox-cronjobs"}}{{index .Data.data.CRONPW}}{{end}}" +EOT + } + + resources { + memory = 50 + memory_max = 256 + cpu = 100 + } + } + + task "backup" { + driver = "podman" + + config { + image = "docker.io/curlimages/curl:latest" + entrypoint = [""] + command = "/bin/sh" + args = ["-c", "curl -v https://plants.in0rdr.ch/cronjob/backup/auto?cronpw=$CRONPW"] + } + + template { + env = true + destination = "${NOMAD_SECRETS_DIR}/env" + data = <<EOT +CRONPW = "{{with secret "kv/hortusfox-cronjobs"}}{{index .Data.data.CRONPW}}{{end}}" +EOT + } + + resources { + memory = 50 + memory_max = 256 + cpu = 100 + } + } + } +}