From e9336eea2aa118216b0a833e19b19321e57d22e3 Mon Sep 17 00:00:00 2001 From: Mathias Magnusson Date: Mon, 21 Aug 2023 19:26:54 +0200 Subject: Add virtual hosting and certificate job specs --- jobs/certificates.nomad.hcl | 49 +++++++++++++++++++ jobs/nginx.nomad.hcl | 114 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 163 insertions(+) create mode 100644 jobs/certificates.nomad.hcl create mode 100644 jobs/nginx.nomad.hcl (limited to 'jobs') diff --git a/jobs/certificates.nomad.hcl b/jobs/certificates.nomad.hcl new file mode 100644 index 0000000..26253b7 --- /dev/null +++ b/jobs/certificates.nomad.hcl @@ -0,0 +1,49 @@ +job "certificates" { + type = "batch" + + periodic { + cron = "@monthly" + } + + group "lego" { + volume "certs" { + type = "host" + source = "ca-certificates" + } + + task "lego" { + driver = "exec" + + volume_mount { + volume = "certs" + destination = "/lego" + } + + config { + command = "lego" + args = [ + "--accept-tos", + "--path", "/lego", + "--email", "mathias+certs@magnusson.space", + "--dns", "cloudflare", + "-d", "magnusson.wiki", "-d", "*.magnusson.wiki", + "run" + ] + } + + artifact { + source = "https://github.com/go-acme/lego/releases/download/v4.13.3/lego_v4.13.3_linux_amd64.tar.gz" + } + + template { + data = <