fix: Deduplicate variable

This commit is contained in:
2024-05-06 20:20:59 +02:00
parent 9481a70c39
commit 8458675875
4 changed files with 10 additions and 10 deletions

View File

@@ -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 }}"