From 8458675875d35daa41149910ef5d1fef3e05ea4b Mon Sep 17 00:00:00 2001 From: "pulsar89.5" Date: Mon, 6 May 2024 20:20:59 +0200 Subject: [PATCH] fix: Deduplicate variable --- README.md | 4 ++-- defaults/main.yml | 2 +- handlers/main.yml | 2 +- tasks/client.yml | 12 ++++++------ 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 14c81f6..df69768 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Liste d'adresses IP auxquelles les requêtes DNS sont transmises si dnsmasq ne p *Valeur par défaut: aucune* -### dnsmasq_servers +### dnsmasq_hosts Liste d'IP ou de noms d'hôtes servant de serveur DNS. @@ -75,7 +75,7 @@ all: ```yaml --- -dnsmasq_servers: "{{ groups['dnsservers'] }}" +dnsmasq_hosts: "{{ groups['dnsservers'] }}" ``` diff --git a/defaults/main.yml b/defaults/main.yml index 428bd9b..3741bed 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -6,7 +6,7 @@ dnsmasq_servers: [] dnsmasq_rev_servers: [] dnsmasq_bogus_priv_enabled: true -dnsmasq_servers: [] +dnsmasq_hosts: [] dnsmasq_host_ips: [] dnsmasq_host_aliases: [] diff --git a/handlers/main.yml b/handlers/main.yml index 7fb2eb3..ebe8314 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -12,7 +12,7 @@ ansible.builtin.systemd: state: reloaded name: dnsmasq.service - loop: "{{ dnsmasq_servers }}" + loop: "{{ dnsmasq_hosts }}" loop_control: loop_var: dnsserver delegate_to: "{{ dnsserver }}" diff --git a/tasks/client.yml b/tasks/client.yml index 90f7b5c..1eac074 100644 --- a/tasks/client.yml +++ b/tasks/client.yml @@ -9,9 +9,9 @@ src: "{{ role_path }}/templates/host.conf.j2" dest: /srv/dnsmasq/{{ dnsmasq_client_filename }}.conf when: - - dnsmasq_servers | length > 0 - - dnsmasq_host_ipv4 not in dnsmasq_servers - loop: "{{ dnsmasq_servers }}" + - dnsmasq_hosts | length > 0 + - dnsmasq_host_ipv4 not in dnsmasq_hosts + loop: "{{ dnsmasq_hosts }}" loop_control: loop_var: dnsserver delegate_to: "{{ dnsserver }}" @@ -23,10 +23,10 @@ path: /srv/dnsmasq/{{ dnsmasq_client_filename }}.conf state: absent when: - - dnsmasq_servers | length > 0 - - dnsmasq_host_ipv4 not in dnsmasq_servers + - dnsmasq_hosts | length > 0 + - dnsmasq_host_ipv4 not in dnsmasq_hosts tags: [destruction, never] - loop: "{{ dnsmasq_servers }}" + loop: "{{ dnsmasq_hosts }}" loop_control: loop_var: dnsserver delegate_to: "{{ dnsserver }}"