aboutsummaryrefslogtreecommitdiffstats
path: root/fdio.infra.ansible/roles/nomad/templates/client.hcl.j2
diff options
context:
space:
mode:
authorpmikus <pmikus@cisco.com>2021-08-27 14:02:21 +0000
committerpmikus <pmikus@cisco.com>2021-08-27 14:02:21 +0000
commit4bf3efc45c708370b5d8bc30ae0fb64c671a3877 (patch)
treedf0d13f1f7b6c0957896c3b94de8f34d093ddca4 /fdio.infra.ansible/roles/nomad/templates/client.hcl.j2
parentbcc8b334d1961894b54c080f3d58032aacb1a048 (diff)
Infra: Cleanup Nomad configs
Signed-off-by: pmikus <pmikus@cisco.com> Change-Id: Ia5c9f0902551de1a63144e6f56dfa6db2895b0b2
Diffstat (limited to 'fdio.infra.ansible/roles/nomad/templates/client.hcl.j2')
-rw-r--r--fdio.infra.ansible/roles/nomad/templates/client.hcl.j247
1 files changed, 38 insertions, 9 deletions
diff --git a/fdio.infra.ansible/roles/nomad/templates/client.hcl.j2 b/fdio.infra.ansible/roles/nomad/templates/client.hcl.j2
index f245697a22..f82f38a4e4 100644
--- a/fdio.infra.ansible/roles/nomad/templates/client.hcl.j2
+++ b/fdio.infra.ansible/roles/nomad/templates/client.hcl.j2
@@ -1,14 +1,44 @@
client {
enabled = {{ nomad_node_client | bool | lower }}
- no_host_uuid = {{ nomad_no_host_uuid | bool | lower }}
+
node_class = "{{ nomad_node_class }}"
+ no_host_uuid = {{ nomad_no_host_uuid | bool | lower }}
+
+{% if nomad_use_consul == False %}
+ {% if nomad_servers -%}
+ servers = [ {% for ip_port in nomad_servers -%} "{{ ip_port }}" {% if not loop.last %},{% endif %}{%- endfor -%} ]
+ {% endif -%}
+{% endif %}
+ {% if nomad_network_interface is defined -%}
+ network_interface = "{{ nomad_network_interface }}"
+ {% endif -%}
+ {% if nomad_network_speed is defined -%}
+ network_speed = "{{ nomad_network_speed }}"
+ {% endif -%}
{% if nomad_cpu_total_compute is defined -%}
cpu_total_compute = {{ nomad_cpu_total_compute }}
{% endif -%}
- {% if nomad_servers -%}
- servers = [ {% for ip_port in nomad_servers -%} "{{ ip_port }}" {% if not loop.last %},{% endif %}{%- endfor -%} ]
+ reserved {
+ cpu = {{ nomad_reserved['cpu'] }}
+ memory = {{ nomad_reserved['memory'] }}
+ disk = {{ nomad_reserved['disk'] }}
+ }
+
+ {% for nomad_host_volume in nomad_volumes -%}
+ host_volume "{{ nomad_host_volume.name }}" {
+ path = "{{ nomad_host_volume.path }}"
+ read_only = {{ nomad_host_volume.read_only | bool | lower }}
+ }
+ {% endfor %}
+
+ {% if nomad_chroot_env != False -%}
+ chroot_env = {
+ {% for key, value in nomad_chroot_env.items() %}
+ "{{ key }}" = "{{ value }}"
+ {% endfor -%}
+ }
{% endif %}
{% if nomad_options -%}
@@ -19,13 +49,12 @@ client {
}
{% endif %}
- {% if nomad_volumes -%}
- {% for volume in nomad_volumes -%}
- host_volume "{{ volume.name }}" {
- path = "{{ volume.path }}"
- read_only = {{ volume.read_only | bool | lower }}
- }
+ {% if nomad_meta -%}
+ meta = {
+ {% for key, value in nomad_meta.items() %}
+ "{{ key }}" = "{{ value }}"
{% endfor -%}
+ }
{% endif %}
}