feat(pxe): Migrate Ubuntu Jammy I.
[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     {% if nomad_node_server | bool -%}
8         raft_protocol = 3
9     {%- endif %}
10
11     {% if nomad_authoritative_region is defined %}
12         authoritative_region = "{{ nomad_authoritative_region }}"
13     {% endif %}
14
15 {% if nomad_use_consul == False %}
16     {% if nomad_retry_join | bool -%}
17         retry_join = [
18             {%- set comma = joiner(",") -%}
19             {% for server in nomad_servers -%}
20                 {{ comma() }}"{{ hostvars[server]['nomad_advertise_address'] | ipwrap }}"
21             {%- endfor -%} ]
22         retry_max = {{ nomad_retry_max }}
23         retry_interval = "{{ nomad_retry_interval }}"
24     {% else -%}
25         start_join = [
26             {%- set comma = joiner(",") -%}
27             {% for server in nomad_servers -%}
28                 {{ comma() }}"{{ hostvars[server]['nomad_advertise_address'] | ipwrap }}"
29             {%- endfor -%} ]
30     {%- endif %}
31 {% endif %}
32
33     encrypt = "{{ nomad_encrypt | default('') }}"
34
35     {% if nomad_node_gc_threshold -%}
36         node_gc_threshold = "{{ nomad_node_gc_threshold }}"
37     {%- endif %}
38
39     {% if nomad_job_gc_interval -%}
40         job_gc_interval = "{{ nomad_job_gc_interval }}"
41     {%- endif %}
42
43     {% if nomad_job_gc_threshold -%}
44         job_gc_threshold = "{{ nomad_job_gc_threshold }}"
45     {%- endif %}
46
47     {% if nomad_eval_gc_threshold -%}
48         eval_gc_threshold = "{{ nomad_eval_gc_threshold }}"
49     {%- endif %}
50
51     {% if nomad_deployment_gc_threshold -%}
52         deployment_gc_threshold = "{{ nomad_deployment_gc_threshold }}"
53     {%- endif %}
54
55 }