diff --git a/nomad-job/authelia.nomad.hcl b/nomad-job/authelia.nomad.hcl new file mode 100644 index 0000000..870a0cd --- /dev/null +++ b/nomad-job/authelia.nomad.hcl @@ -0,0 +1,161 @@ + +job "authelia" { + datacenters = ["homelab"] + priority = 80 + type = "service" + meta { + forcedeploy = "0" + } + constraint { + attribute = "${attr.cpu.arch}" + value = "amd64" + } + + group "authelia" { + network { + mode = "host" + port "authelia" { + to = 9091 + } + } + volume "authelia-config" { + type = "csi" + source = "authelia-config" + access_mode = "multi-node-multi-writer" + attachment_mode = "file-system" + } + vault { + policies = ["authelia"] + + } + task "authelia" { + driver = "docker" + service { + name = "authelia" + port = "authelia" + tags = [ + "traefik.enable=true", + "traefik.http.routers.${NOMAD_JOB_NAME}.rule=Host(`auth.ducamps.eu`)", + "traefik.http.routers.${NOMAD_JOB_NAME}.tls.domains[0].sans=auth.ducamps.eu", + "traefik.http.routers.${NOMAD_JOB_NAME}.tls.certresolver=myresolver", + "traefik.http.routers.${NOMAD_JOB_NAME}.entrypoints=web,websecure", + + + ] + } + config { + image = "authelia/authelia" + ports = ["authelia"] + args = [ + "--config", + "/local/configuration.yml", + ] + + + } + volume_mount { + volume = "authelia-config" + destination = "/config" + } + env { + AUTHELIA_SESSION_SECRET = uuidv4() + AUTHELIA_IDENTITY_VALIDATION_RESET_PASSWORD_JWT_SECRET = uuidv4() + } + + template { + data = <