Common: Manage DNS
This commit is contained in:
parent
a8b764d115
commit
b4b4ae6e29
@ -60,12 +60,27 @@
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0600'
|
||||
notify: Reload Network
|
||||
notify: Restart Network
|
||||
- name: Setup DNS
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/systemd/resolved.conf
|
||||
regexp: "{{ item.regexp }}"
|
||||
line: "{{ item.line }}"
|
||||
notify: Restart systemd-resolved
|
||||
loop:
|
||||
- regexp: "^DNS="
|
||||
line: "DNS=1.1.1.1"
|
||||
- regexp: "^FallbackDNS="
|
||||
line: "FallbackDNS=8.8.8.8"
|
||||
handlers:
|
||||
- name: Reload Network
|
||||
- name: Restart Network
|
||||
ansible.builtin.systemd:
|
||||
name: NetworkManager.service
|
||||
state: restarted
|
||||
- name: Restart systemd-resolved
|
||||
ansible.builtin.systemd:
|
||||
name: systemd-resolved.service
|
||||
state: restarted
|
||||
|
||||
|
||||
- name: Backup
|
||||
|
Loading…
Reference in New Issue
Block a user