equal
deleted
inserted
replaced
|
1 --- |
|
2 |
|
3 - name: check if resolv.conf exists |
|
4 stat: path="/etc/resolv.conf" |
|
5 register: sym |
|
6 |
|
7 - name: replace systemd-resolved conf stub |
|
8 become: yes |
|
9 copy: |
|
10 remote_src: yes |
|
11 src: "/run/systemd/resolve/resolv.conf" |
|
12 dest: "/etc/resolv.conf" |
|
13 when: sym.stat.islnk is defined and sym.stat.islnk |
|
14 |
|
15 - name: ensure nameserver is self |
|
16 become: yes |
|
17 lineinfile: |
|
18 path: "/etc/resolv.conf" |
|
19 regexp: "^nameserver" |
|
20 line: "nameserver {{ansible_default_ipv4.address}}" |
|
21 |
|
22 - name: disable systemd-resolved service |
|
23 become: yes |
|
24 systemd: name="systemd-resolved.service" enabled="no" state="stopped" |