28 lines
680 B
YAML
28 lines
680 B
YAML
---
|
|
- hosts: all
|
|
become: yes
|
|
tasks:
|
|
- name: Disable resolvconf
|
|
service: name={{ item }} state=stopped enabled=no
|
|
with_items:
|
|
- resolvconf
|
|
- systemd-resolved
|
|
ignore_errors: yes
|
|
|
|
- name: Remove resolvconf
|
|
package:
|
|
name: resolvconf
|
|
state: absent
|
|
|
|
- name: Remove immutable on resolv.conf
|
|
command: chattr -i /etc/resolv.conf
|
|
|
|
- name: Copy resolv.conf
|
|
copy:
|
|
src: resolv.conf
|
|
dest: /etc/resolv.conf
|
|
# attributes: 'ie'
|
|
|
|
- name: Set immutable on resolv.conf
|
|
command: chattr +i /etc/resolv.conf
|