CSC Ansible Playbooks
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible-playbooks/resolv.yml

28 lines
680 B

---
- 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