File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
mkosi.images/terraform/share/terraform Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -34,10 +34,10 @@ job "consul" {
3434 template {
3535 data = <<- EOF
3636 encrypt = "{{ with secret "secrets/mangos/consul/gossip" }}{{ .Data.encryption_key | trimSpace }}{{ end }}"
37- node_name = "consul-api-{{ env "NOMAD_SHORT_ALLOC_ID" }}"
3837 addresses {
3938 dns = "0.0.0.0"
4039 }
40+ node_name = "consul-api-{{ env "NOMAD_SHORT_ALLOC_ID" }}"
4141 acl {
4242 enabled = true
4343 tokens {
@@ -52,11 +52,17 @@ job "consul" {
5252 destination = " ${ NOMAD_SECRETS_DIR } /consul.hcl"
5353 change_mode = " restart"
5454 }
55+
5556 driver = " docker"
57+
58+ env {
59+ HOST_IP = " ${ attr . unique . network . ip-address } "
60+ }
61+
5662 config {
5763 image = " hashicorp/consul"
5864 args = [" agent" ,
59- " -retry-join" , " 10.0.2.15 " ,
65+ " -retry-join" , " ${ HOST_IP } " ,
6066 " -datacenter" , " ${ NOMAD_REGION } -${ NOMAD_DC } " ,
6167 " -config-file" , " ${ NOMAD_SECRETS_DIR } /consul.hcl" ]
6268 }
You can’t perform that action at this time.
0 commit comments