Ansible idempotently change file attributes
Ansible idempotently change file attributes
---
- name: Ensure resolv.conf is immutable.
file:
path: /etc/resolv.conf
attr: +i
register: resolv_file
changed_when: "'i' not in resolv_file.diff.before.attributes"