Added dns fix magic
This commit is contained in:
parent
f851f907d1
commit
1ca623a038
5
files/resolv.conf
Normal file
5
files/resolv.conf
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# This file is Ansible managed... or something
|
||||||
|
nameserver 152.66.208.1
|
||||||
|
nameserver 152.66.208.29
|
||||||
|
nameserver 152.66.115.1
|
||||||
|
nameserver 152.66.116.1
|
@ -19,5 +19,8 @@
|
|||||||
- name: "clean motd"
|
- name: "clean motd"
|
||||||
import_tasks: tasks/clean-motd.yaml
|
import_tasks: tasks/clean-motd.yaml
|
||||||
|
|
||||||
|
- name: "fix dns"
|
||||||
|
import_tasks: tasks/fix-dns-resolution.yaml
|
||||||
|
|
||||||
- name: "setup networking"
|
- name: "setup networking"
|
||||||
import_tasks: tasks/static-networking.yaml
|
import_tasks: tasks/static-networking.yaml
|
24
tasks/fix-dns-resolution.yaml
Normal file
24
tasks/fix-dns-resolution.yaml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
- name: "disable systemd-resolved"
|
||||||
|
systemd:
|
||||||
|
name: systemd-resolved
|
||||||
|
state: stopped
|
||||||
|
enabled: no
|
||||||
|
masked: yes
|
||||||
|
|
||||||
|
- name: check if resolvconf linked
|
||||||
|
stat:
|
||||||
|
path: /etc/resolv.conf
|
||||||
|
register: link
|
||||||
|
|
||||||
|
- name: remove symlink
|
||||||
|
file:
|
||||||
|
path: /etc/resolv.conf
|
||||||
|
state: absent
|
||||||
|
when: link.stat.islnk is defined and link.stat.islnk
|
||||||
|
|
||||||
|
- name: set very good resolv config
|
||||||
|
copy:
|
||||||
|
src: resolv.conf
|
||||||
|
dest: /etc/resolv.conf
|
||||||
|
mode: 644
|
||||||
|
owner: root
|
Loading…
Reference in New Issue
Block a user