adguard-home/tasks/enable-dns-bypass.yaml
changeset 226 ce33bf94045f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/adguard-home/tasks/enable-dns-bypass.yaml	Sun Jan 21 15:58:58 2024 -0600
@@ -0,0 +1,17 @@
+---
+
+- name: check if resolv.conf exists
+  stat: path="/etc/resolv.conf"
+  register: sym
+
+- name: replace systemd-resolved conf link
+  become: yes
+  file:
+    src:  "../run/systemd/resolve/stub-resolv.conf"
+    dest: "/etc/resolv.conf"
+    state: "link"
+  when: sym.stat.islnk is defined and not sym.stat.islnk
+
+- name: enable systemd-resolved service
+  become: yes
+  systemd: name="systemd-resolved.service" enabled="yes" state="started"