mirror of
https://github.com/roles-ansible/ansible_role_resolvconf.git
synced 2024-08-16 10:09:52 +02:00
30 lines
772 B
YAML
30 lines
772 B
YAML
---
|
|
- ansible.builtin.include_tasks: versioncheck.yml
|
|
when: submodules_versioncheck|bool
|
|
|
|
- name: resolv.conf is ino longer immutable.
|
|
become: true
|
|
ansible.builtin.file:
|
|
path: '/etc/resolv.conf'
|
|
attr: '-i'
|
|
register: resolv_file
|
|
changed_when: "resolv_file.changed and not resolveconf__immutable"
|
|
ignore_errors: true
|
|
|
|
- name: "Configure resolv.conf"
|
|
become: true
|
|
ansible.builtin.template:
|
|
src: 'templates/resolv.conf.j2'
|
|
dest: '/etc/resolv.conf'
|
|
mode: "{{ resolvconf__mode }}"
|
|
owner: root
|
|
group: root
|
|
|
|
- name: Ensure resolv.conf is immutable.
|
|
become: true
|
|
ansible.builtin.file:
|
|
path: '/etc/resolv.conf'
|
|
attr: '+i'
|
|
register: resolv_file
|
|
changed_when: "not resolv_file.changed"
|
|
when: resolveconf__immutable | bool
|