author | Luke Hoersten <luke@hoersten.org> |
Mon, 07 Oct 2024 23:31:51 -0500 | |
changeset 239 | c3e3169399a8 |
parent 226 | ce33bf94045f |
permissions | -rw-r--r-- |
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 stub |
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 |
copy: |
ce33bf94045f
Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
10 |
remote_src: yes |
ce33bf94045f
Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
11 |
src: "/run/systemd/resolve/resolv.conf" |
ce33bf94045f
Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
12 |
dest: "/etc/resolv.conf" |
ce33bf94045f
Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
13 |
when: sym.stat.islnk is defined and 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: ensure nameserver is self |
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 |
lineinfile: |
ce33bf94045f
Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
18 |
path: "/etc/resolv.conf" |
ce33bf94045f
Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
19 |
regexp: "^nameserver" |
ce33bf94045f
Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
20 |
line: "nameserver {{ansible_default_ipv4.address}}" |
ce33bf94045f
Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
21 |
|
ce33bf94045f
Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
22 |
- name: disable systemd-resolved service |
ce33bf94045f
Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
23 |
become: yes |
ce33bf94045f
Added optional admin-local DNS bypass.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
24 |
systemd: name="systemd-resolved.service" enabled="no" state="stopped" |