X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=fdio.infra.ansible%2Froles%2Fnomad%2Ftemplates%2Fserver.hcl.j2;h=663ee3a5494d5e1e10aa1cd410bcda6054bbe240;hb=dc200e7f96297b3bccecb88b4e951b142617734b;hp=b581de9ad07273ccf460718069cc8bdb86a3950a;hpb=df5672b3d9c29b51397f4770eb992c9f3f3955ce;p=csit.git diff --git a/fdio.infra.ansible/roles/nomad/templates/server.hcl.j2 b/fdio.infra.ansible/roles/nomad/templates/server.hcl.j2 index b581de9ad0..663ee3a549 100644 --- a/fdio.infra.ansible/roles/nomad/templates/server.hcl.j2 +++ b/fdio.infra.ansible/roles/nomad/templates/server.hcl.j2 @@ -5,12 +5,48 @@ 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 -%} - server_join { - retry_join = [ {% for ip_port in nomad_retry_servers -%} "{{ ip_port }}" {% if not loop.last %},{% endif %}{%- endfor -%} ] - } + 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 }}" + {%- endif %} + + {% if nomad_job_gc_interval -%} + job_gc_interval = "{{ nomad_job_gc_interval }}" + {%- endif %} + + {% if nomad_job_gc_threshold -%} + job_gc_threshold = "{{ nomad_job_gc_threshold }}" + {%- endif %} + + {% if nomad_eval_gc_threshold -%} + eval_gc_threshold = "{{ nomad_eval_gc_threshold }}" + {%- endif %} + + {% if nomad_deployment_gc_threshold -%} + deployment_gc_threshold = "{{ nomad_deployment_gc_threshold }}" {%- endif %} }