From b6c1e1bbfdd932f8d242725e1875bac0b0a883d2 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Tue, 27 May 2025 15:00:12 +0200 Subject: [PATCH] Update to 2025-05-27 15:00 --- roles/nomad/tasks/directories.yml | 4 ++++ roles/nomad/templates/nomad.hcl.j2 | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/roles/nomad/tasks/directories.yml b/roles/nomad/tasks/directories.yml index e2ef021..5e6d14d 100644 --- a/roles/nomad/tasks/directories.yml +++ b/roles/nomad/tasks/directories.yml @@ -66,3 +66,7 @@ when: item.create | default(False) tags: nomad +- name: Create host_volumes_dir directory + file: path={{ nomad_conf.client.host_volumes_dir }} state=directory owner={{ nomad_user }} group={{ nomad_user }} mode=770 + when: nomad_conf.client.host_volumes_dir is defined + tags: nomad diff --git a/roles/nomad/templates/nomad.hcl.j2 b/roles/nomad/templates/nomad.hcl.j2 index e136978..86eec31 100644 --- a/roles/nomad/templates/nomad.hcl.j2 +++ b/roles/nomad/templates/nomad.hcl.j2 @@ -101,9 +101,11 @@ client { # Required for alloc to be able to reach themselves through an exposed port bridge_network_hairpin_mode = true -{% if nomad_conf.client.node_pool is defined %} - node_pool = "{{ nomad_conf.client.node_pool }}" +{% for conf in ['node_pool', 'host_volumes_dir'] %} +{% if nomad_conf.client[conf] is defined %} + {{ conf }} = "{{ nomad_conf.client[conf] }}" {% endif %} +{% endfor %} {% if nomad_conf.client.drain_on_shutdown is defined %} drain_on_shutdown {