src.nth.io/

summaryrefslogtreecommitdiff
path: root/adguard-home/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'adguard-home/tasks')
-rw-r--r--adguard-home/tasks/main.yaml14
1 files changed, 9 insertions, 5 deletions
diff --git a/adguard-home/tasks/main.yaml b/adguard-home/tasks/main.yaml
index 6be6ac5..8d3af39 100644
--- a/adguard-home/tasks/main.yaml
+++ b/adguard-home/tasks/main.yaml
@@ -44,16 +44,20 @@
template: src="AdGuardHome.yaml.j2" dest="/etc/AdGuardHome/AdGuardHome.yaml"
notify: restart adguard home
-- name: disable systemd-resolved service
- become: yes
- systemd: name="systemd-resolved.service" enabled="no" state="stopped"
+- stat: "path=/etc/resolv.conf"
+ register: sym
- name: replace systemd-resolved conf stub
become: yes
- file:
+ copy:
+ remote_src: yes
src: "/run/systemd/resolve/resolv.conf"
dest: "/etc/resolv.conf"
- state: "link"
+ when: sym.stat.islnk is defined and sym.stat.islnk
+
+- name: disable systemd-resolved service
+ become: yes
+ systemd: name="systemd-resolved.service" enabled="no" state="stopped"
- name: ensure adguard home is started
become: yes