diff --git a/defaults/main.yml b/defaults/main.yml index 7a5d914..8a92121 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -17,13 +17,16 @@ pihole_port: - "67:67/udp" - "{{pihole_http_port}}:80/tcp" -pihole_forwarder1: '1.1.1.1' -pihole_forwarder2: '80.67.169.40' +pihole_forwarder1: "1.1.1.1" +pihole_forwarder2: "80.67.169.40" pihole_timezone: "Europe/Paris" -pihole_local_domain: pihole.lan -pihole_local_reverse_domain: '1.168.192.in-addr.arpa' +pihole_local_domain: + - domain: local.lan + resolver: "{{ pihole_local_resolver }}" + - domain: "1.168.192.in-addr.arpa" + resolver: "{{ pihole_local_resolver }}" pihole_local_resolver: pihole_dns_servers: - - '127.0.0.1' - - '{{pihole_local_resolver | default(1.1.1.1)}}' -pihole_update_container: false \ No newline at end of file + - "127.0.0.1" + - "{{pihole_local_resolver | default(1.1.1.1)}}" +pihole_update_container: false diff --git a/templates/02-localresolver.conf.j2 b/templates/02-localresolver.conf.j2 index d77cd10..c3e45f7 100644 --- a/templates/02-localresolver.conf.j2 +++ b/templates/02-localresolver.conf.j2 @@ -1,5 +1,5 @@ # {{ ansible_managed }} ## local domain forwarder -server=/local.lan/{{pihole_local_resolver}} -server=/{{pihole_local_domain}}/{{pihole_local_resolver}} -server=/{{pihole_local_reverse_domain}}/{{pihole_local_resolver}} +{% for localresolver in pihole_local_domain %} +server=/{{localresolver.domain}}/{{localresolver.resolver}} +{% endfor %}