src.nth.io/

summaryrefslogtreecommitdiff
path: root/adguard-home/tasks
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2020-07-09 18:49:48 -0500
committerLuke Hoersten <[email protected]>2020-07-09 18:49:48 -0500
commit19d113bf1103618fe587dee3b4a6b293c3f7ad2e (patch)
tree303a6d813c03cdfbd393ff2c80ac15351213f308 /adguard-home/tasks
parent481b89f5d7969517d5dff6285695e6c9d3e39a4c (diff)
Fixed resolv.conf in adguard role.
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