aboutsummaryrefslogtreecommitdiffstats
path: root/fdio.infra.ansible/roles/nomad/templates/server.hcl.j2
diff options
context:
space:
mode:
Diffstat (limited to 'fdio.infra.ansible/roles/nomad/templates/server.hcl.j2')
-rw-r--r--fdio.infra.ansible/roles/nomad/templates/server.hcl.j230
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 %}
-
}