adguard-home/tasks/enable-dns-bypass.yaml
author Luke Hoersten <luke@hoersten.org>
Sat, 10 Feb 2024 15:40:36 -0600
changeset 229 7e3bf48e516a
parent 226 ce33bf94045f
permissions -rw-r--r--
Dendrite tweaks.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
226
ce33bf94045f Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     1
---
ce33bf94045f Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     2
ce33bf94045f Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     3
- name: check if resolv.conf exists
ce33bf94045f Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     4
  stat: path="/etc/resolv.conf"
ce33bf94045f Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     5
  register: sym
ce33bf94045f Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     6
ce33bf94045f Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     7
- name: replace systemd-resolved conf link
ce33bf94045f Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     8
  become: yes
ce33bf94045f Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     9
  file:
ce33bf94045f Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    10
    src:  "../run/systemd/resolve/stub-resolv.conf"
ce33bf94045f Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    11
    dest: "/etc/resolv.conf"
ce33bf94045f Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    12
    state: "link"
ce33bf94045f Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    13
  when: sym.stat.islnk is defined and not sym.stat.islnk
ce33bf94045f Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    14
ce33bf94045f Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    15
- name: enable systemd-resolved service
ce33bf94045f Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    16
  become: yes
ce33bf94045f Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    17
  systemd: name="systemd-resolved.service" enabled="yes" state="started"