feat(ansible): Migrate Ubuntu Jammy IV.
[csit.git] / fdio.infra.ansible / roles / nomad / templates / server.hcl.j2
1 server {
2     enabled = {{ nomad_node_server | bool | lower }}
3
4     {% if nomad_node_server | bool -%}
5         bootstrap_expect = {{ nomad_bootstrap_expect }}
6     {%- endif %}
7
8     {% if nomad_node_server | bool -%}
9         raft_protocol = 3
10     {%- endif %}
11
12     {% if nomad_authoritative_region is defined %}
13         authoritative_region = "{{ nomad_authoritative_region }}"
14     {% endif %}
15
16 {% if nomad_use_consul == False %}
17     {% if nomad_retry_join | bool -%}
18         retry_join = [
19             {%- set comma = joiner(",") -%}
20             {% for server in nomad_servers -%}
21                 {{ comma() }}"{{ hostvars[server]['nomad_advertise_address'] | ipwrap }}"
22             {%- endfor -%} ]
23         retry_max = {{ nomad_retry_max }}
24         retry_interval = "{{ nomad_retry_interval }}"
25     {% else -%}
26         start_join = [
27             {%- set comma = joiner(",") -%}
28             {% for server in nomad_servers -%}
29                 {{ comma() }}"{{ hostvars[server]['nomad_advertise_address'] | ipwrap }}"
30             {%- endfor -%} ]
31     {%- endif %}
32 {% endif %}
33
34     encrypt = "{{ nomad_encrypt | default('') }}"
35
36     {% if nomad_node_gc_threshold -%}
37         node_gc_threshold = "{{ nomad_node_gc_threshold }}"
38     {%- endif %}
39
40     {% if nomad_job_gc_interval -%}
41         job_gc_interval = "{{ nomad_job_gc_interval }}"
42     {%- endif %}
43
44     {% if nomad_job_gc_threshold -%}
45         job_gc_threshold = "{{ nomad_job_gc_threshold }}"
46     {%- endif %}
47
48     {% if nomad_eval_gc_threshold -%}
49         eval_gc_threshold = "{{ nomad_eval_gc_threshold }}"
50     {%- endif %}
51
52     {% if nomad_deployment_gc_threshold -%}
53         deployment_gc_threshold = "{{ nomad_deployment_gc_threshold }}"
54     {%- endif %}
55
56 }