From 16e7339eb685cad8b310f209e161c661283910e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Jeanneret?= Date: Thu, 20 Jun 2024 20:46:34 +0200 Subject: [PATCH] Switch to dhcp-hostsfile We hit a race condition with ansible creating the DHCP file with strict rights, ionitofy kicking in, dnsmasq trying to read the file and failing. This prevented the service to load a DHCP host configuration, leading to issues. With this change, we ensure we keep a directory, but we have to trigger the reload ourself - like before. This ensures the rights are all applied. --- roles/dnsmasq/tasks/manage_host.yml | 1 + roles/dnsmasq/templates/cifmw-dnsmasq.conf.j2 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/dnsmasq/tasks/manage_host.yml b/roles/dnsmasq/tasks/manage_host.yml index 9c94796454..6cc702e37f 100644 --- a/roles/dnsmasq/tasks/manage_host.yml +++ b/roles/dnsmasq/tasks/manage_host.yml @@ -58,6 +58,7 @@ - name: Manage host entry - add become: true + notify: Reload dnsmasq when: - cifmw_dnsmasq_host_state == 'present' ansible.builtin.copy: diff --git a/roles/dnsmasq/templates/cifmw-dnsmasq.conf.j2 b/roles/dnsmasq/templates/cifmw-dnsmasq.conf.j2 index a64251b100..2054bf4382 100644 --- a/roles/dnsmasq/templates/cifmw-dnsmasq.conf.j2 +++ b/roles/dnsmasq/templates/cifmw-dnsmasq.conf.j2 @@ -9,4 +9,4 @@ dhcp-leasefile=/var/lib/dnsmasq/cifmw-dnsmasq.leases {% endif %} conf-dir={{ cifmw_dnsmasq_basedir }},*.conf -dhcp-hostsdir="{{ cifmw_dnsmasq_basedir }}/dhcp-hosts.d" +dhcp-hostsfile="{{ cifmw_dnsmasq_basedir }}/dhcp-hosts.d"