adguard-home/tasks/enable-dns-bypass.yaml
author Luke Hoersten <luke@hoersten.org>
Sun, 21 Jul 2024 12:42:43 -0500
changeset 235 f88bb54f63bd
parent 226 ce33bf94045f
permissions -rw-r--r--
Added scrypted role.
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"