diff --git a/prep.d/mv_conf.sh b/prep.d/mv_conf.sh index 7543bb2..e8ba9a7 100755 --- a/prep.d/mv_conf.sh +++ b/prep.d/mv_conf.sh @@ -1 +1 @@ -[[ template "common/mv_conf.sh.tpl" dict "ctx" . "services" (dict "smtp-relay" .mail.relay.instance) ]] +[[ template "common/mv_conf.sh" dict "ctx" . "services" (dict "smtp-relay" .instance) ]] diff --git a/smtp-relay.nomad.hcl b/smtp-relay.nomad.hcl index 59fddce..3b3a8b1 100644 --- a/smtp-relay.nomad.hcl +++ b/smtp-relay.nomad.hcl @@ -1,6 +1,6 @@ [[ $c := merge .mail.relay . -]] -job [[ .mail.relay.instance | toJSON ]] { +job [[ .instance | toJSON ]] { [[ template "common/job_start.tpl" $c ]] @@ -21,7 +21,7 @@ job [[ .mail.relay.instance | toJSON ]] { } service { - name = "[[ .mail.relay.instance ]][[ .consul.suffix ]]" + name = "[[ .instance ]][[ .consul.suffix ]]" port = 8025 [[ template "common/connect.tpl" $c ]] @@ -35,13 +35,13 @@ job [[ .mail.relay.instance | toJSON ]] { } vault { - policies = ["[[ .mail.relay.instance ]][[ .consul.suffix ]]"] + policies = ["[[ .instance ]][[ .consul.suffix ]]"] env = false disable_file = true } env { - HOSTNAME = "[[ .mail.relay.instance ]].service.[[ .consul.domain ]]" + HOSTNAME = "[[ .instance ]].service.[[ .consul.domain ]]" LOCAL_DOMAINS = "" RELAY_FROM_HOSTS = "127.0.0.1" DISABLE_SENDER_VERIFICATION = "true" diff --git a/variables.yml b/variables.yml index 5455876..c879d77 100644 --- a/variables.yml +++ b/variables.yml @@ -1,12 +1,12 @@ --- +# The Nomad job name +instance: smtp-relay + mail: relay: - # The Nomad job name - instance: smtp-relay - # The image to use - image: danielberteaud/exim-relay:23.12-1 + image: '[[ .docker.repo ]]exim-relay:23.12-1' # Number of instances to run count: 1 @@ -24,7 +24,7 @@ mail: port: 587 tls: True user: smtp@example.org - password: '{{ with secret "[[ .vault.prefix ]]kv/service/[[ .mail.relay.instance ]]" }}{{ .Data.data.pwd }}{{ end }}' + password: '{{ with secret "[[ .vault.prefix ]]kv/service/[[ .instance ]]" }}{{ .Data.data.pwd }}{{ end }}' # The volume to use for /var/spool/postfix volume: