Skip to content

Commit 4a38157

Browse files
committed
services/nomad/apps: Pull certificates from nomad variables
1 parent fe46e6c commit 4a38157

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

services/nomad/apps/maddy.nomad

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ job "maddy" {
3030
task "maddy" {
3131
driver = "docker"
3232

33-
vault {
34-
policies = ["void-secrets-maddy"]
35-
}
36-
3733
volume_mount {
3834
volume = "maddy_data"
3935
destination = "/data"
@@ -68,21 +64,13 @@ job "maddy" {
6864
}
6965

7066
template {
71-
data =<<EOF
72-
{{- with secret "secret/lego/data/certificates/_.voidlinux.org.crt" -}}
73-
{{.Data.contents}}
74-
{{- end -}}
75-
EOF
67+
data = "{{ with nomadVar \"nomad/jobs/maddy\" }}{{ .certificate }}{{ end }}"
7668
destination = "secrets/tls/fullchain.pem"
7769
perms = 400
7870
}
7971

8072
template {
81-
data =<<EOF
82-
{{- with secret "secret/lego/data/certificates/_.voidlinux.org.key" -}}
83-
{{.Data.contents}}
84-
{{- end -}}
85-
EOF
73+
data = "{{ with nomadVar \"nomad/jobs/maddy\" }}{{ .key }}{{ end }}"
8674
destination = "secrets/tls/privkey.pem"
8775
perms = 400
8876
}

0 commit comments

Comments
 (0)