Technotes

Technotes for future me

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"
Last updated on 31 Jan 2021
Published on 11 Dec 2019
Edit on GitHub