From da4b10d92cddf8dbcdda26559d03a65caba3a12e Mon Sep 17 00:00:00 2001 From: mg Date: Fri, 26 Feb 2021 09:37:23 +0100 Subject: [PATCH] Bugfix. PiHole (#3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Doku Housekeeping Setze DNS-Resolver für Pihole Co-authored-by: Michael Grote Reviewed-on: https://git.mgrote.net/mg/ansible/pulls/3 Co-Authored-By: mg Co-Committed-By: mg --- inventory | 2 -- playbooks/service/dns.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 playbooks/service/dns.yml diff --git a/inventory b/inventory index 22b71aa5..9fb38ed8 100644 --- a/inventory +++ b/inventory @@ -14,7 +14,6 @@ all: fileserver-test.grote.lan: dns: hosts: - pi.hole: pihole2-test.grote.lan: pihole2.grote.lan: acng: @@ -75,7 +74,6 @@ all: wireguard-test.grote.lan: dokuwiki-test.grote.lan: fileserver-test.grote.lan: - pihole-test.grote.lan: acng-test.grote.lan: ansible-test.grote.lan: docker-test.grote.lan: diff --git a/playbooks/service/dns.yml b/playbooks/service/dns.yml new file mode 100644 index 00000000..7dc1b67a --- /dev/null +++ b/playbooks/service/dns.yml @@ -0,0 +1,26 @@ +--- + - hosts: dns + become: yes + + tasks: + - name: Setze DNS-Resolver fuer pihole-* + ansible.builtin.lineinfile: + path: /etc/resolv.conf.head + line: nameserver 192.168.2.3 + create: yes + backrefs: false + mode: 0664 + +# Wenn die VM beim Start mit "systemd-networkd-wait-online." hängt +# Deaktiviere DHCP in: +# sudo nano /etc/netplan/01-netcfg.yaml +# network: +# version: 2 +# ethernets: +# ens18: +# addresses: +# - 192.168.2.3/24 +# dhcp4: no +# gateway4: 192.168.2.1 +# netplan apply +# sudo init 6