From 215a0df6a7943ba5d6489b1c09978957979e5bdf Mon Sep 17 00:00:00 2001 From: vincent Date: Tue, 14 Nov 2023 17:57:48 +0100 Subject: [PATCH] add Default interface parameter --- defaults/main.yml | 1 + templates/config.hcl.j2 | 3 +++ 2 files changed, 4 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 7849243..6cfe67c 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -24,3 +24,4 @@ nomad_host_networks: nomad_allow_privileged: False nomad_plugins_podman: False nomad_docker_allow_caps: [] +nomad_client_network_interface: diff --git a/templates/config.hcl.j2 b/templates/config.hcl.j2 index 8f27c83..ab8713f 100644 --- a/templates/config.hcl.j2 +++ b/templates/config.hcl.j2 @@ -9,6 +9,9 @@ enabled = {{ nomad_server |lower }} client { enabled = true +{% if nomad_client_network_interface %} + network_interface = "{{ nomad_client_network_interface }}" +{% endif %} {% for nomad_host_volume in nomad_host_volumes %} host_volume "{{ nomad_host_volume['name'] }}" { path = "{{ nomad_host_volume['path'] }}"