diff options
author | pmikus <pmikus@cisco.com> | 2021-08-27 14:02:21 +0000 |
---|---|---|
committer | pmikus <pmikus@cisco.com> | 2021-08-27 14:02:21 +0000 |
commit | 4bf3efc45c708370b5d8bc30ae0fb64c671a3877 (patch) | |
tree | df0d13f1f7b6c0957896c3b94de8f34d093ddca4 /fdio.infra.ansible/roles/nomad/templates/server.hcl.j2 | |
parent | bcc8b334d1961894b54c080f3d58032aacb1a048 (diff) |
Infra: Cleanup Nomad configs
Signed-off-by: pmikus <pmikus@cisco.com>
Change-Id: Ia5c9f0902551de1a63144e6f56dfa6db2895b0b2
Diffstat (limited to 'fdio.infra.ansible/roles/nomad/templates/server.hcl.j2')
-rw-r--r-- | fdio.infra.ansible/roles/nomad/templates/server.hcl.j2 | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/fdio.infra.ansible/roles/nomad/templates/server.hcl.j2 b/fdio.infra.ansible/roles/nomad/templates/server.hcl.j2 index 5ccf45c1ac..663ee3a549 100644 --- a/fdio.infra.ansible/roles/nomad/templates/server.hcl.j2 +++ b/fdio.infra.ansible/roles/nomad/templates/server.hcl.j2 @@ -5,7 +5,29 @@ server { bootstrap_expect = {{ nomad_bootstrap_expect }} {%- endif %} - encrypt = "{{ nomad_encrypt }}" + {% if nomad_authoritative_region is defined %} + authoritative_region = "{{ nomad_authoritative_region }}" + {% endif %} + +{% if nomad_use_consul == False %} + {% if nomad_retry_join | bool -%} + retry_join = [ + {%- set comma = joiner(",") -%} + {% for server in nomad_servers -%} + {{ comma() }}"{{ hostvars[server]['nomad_advertise_address'] | ipwrap }}" + {%- endfor -%} ] + retry_max = {{ nomad_retry_max }} + retry_interval = "{{ nomad_retry_interval }}" + {% else -%} + start_join = [ + {%- set comma = joiner(",") -%} + {% for server in nomad_servers -%} + {{ comma() }}"{{ hostvars[server]['nomad_advertise_address'] | ipwrap }}" + {%- endfor -%} ] + {%- endif %} +{% endif %} + + encrypt = "{{ nomad_encrypt | default('') }}" {% if nomad_node_gc_threshold -%} node_gc_threshold = "{{ nomad_node_gc_threshold }}" @@ -27,10 +49,4 @@ server { deployment_gc_threshold = "{{ nomad_deployment_gc_threshold }}" {%- endif %} - {% if nomad_retry_join | bool -%} - server_join { - retry_join = [ {% for ip_port in nomad_retry_servers -%} "{{ ip_port }}" {% if not loop.last %},{% endif %}{%- endfor -%} ] - } - {%- endif %} - } |