Allow custom job_name

This commit is contained in:
Daniel Berteaud 2023-09-03 23:05:25 +02:00
parent ec5820bf59
commit 96d2e63cc6
4 changed files with 9 additions and 5 deletions

2
deps/common vendored

@ -1 +1 @@
Subproject commit 8cfe263f274b066e8021e5f821ef6fd465f645f9
Subproject commit 026777bd644b84396138f1c3e940c93d1f78b563

1
prep.d/mv_conf.sh Executable file
View File

@ -0,0 +1 @@
[[ template "common/mv_conf.sh.tpl" dict "ctx" . "services" (dict "smtp-relay" .mail.relay.job_name) ]]

View File

@ -1,4 +1,4 @@
job "smtp-relay" {
job [[ .mail.relay.job_name | toJSON ]] {
[[ template "common/job_start.tpl" . ]]
@ -21,7 +21,7 @@ job "smtp-relay" {
}
service {
name = "smtp-relay[[ .env.suffix ]]"
name = "[[ .mail.relay.job_name ]][[ .env.suffix ]]"
port = 8025
[[ template "common/connect.tpl" dict "ctx" . "config" .mail.relay ]]
@ -35,13 +35,13 @@ job "smtp-relay" {
}
vault {
policies = ["smtp-relay[[ .env.suffix ]]"]
policies = ["[[ .mail.relay.job_name ]][[ .env.suffix ]]"]
env = false
disable_file = true
}
env {
HOSTNAME = "smtp-relay.service.[[ .consul.domain ]]"
HOSTNAME = "[[ .mail.relay.job_name ]].service.[[ .consul.domain ]]"
LOCAL_DOMAINS = ""
RELAY_FROM_HOSTS = "127.0.0.1"
DISABLE_SENDER_VERIFICATION = "true"

View File

@ -2,6 +2,9 @@
mail:
relay:
# The Nomad job name
job_name: smtp-relay
# The image to use
image: danielberteaud/exim-relay:20230829-1