ansible.posix.acl – Set and retrieve file ACL information.¶
This plugin is part of the ansible.posix collection.
To install it use:
ansible-galaxy collection install ansible.posix.
To use it in a playbook, specify:
New in version 1.0.0: of ansible.posix
aclmodule requires that ACLs are enabled on the target filesystem and that the
getfaclbinaries are installed.
As of Ansible 2.0, this module only supports Linux distributions.
As of Ansible 2.3, the name option has been changed to path as default, but name still works as well.
- name: Grant user Joe read access to a file ansible.posix.acl: path: /etc/foo.conf entity: joe etype: user permissions: r state: present - name: Removes the ACL for Joe on a specific file ansible.posix.acl: path: /etc/foo.conf entity: joe etype: user state: absent - name: Sets default ACL for joe on /etc/foo.d/ ansible.posix.acl: path: /etc/foo.d/ entity: joe etype: user permissions: rw default: yes state: present - name: Same as previous but using entry shorthand ansible.posix.acl: path: /etc/foo.d/ entry: default:user:joe:rw- state: present - name: Obtain the ACL for a specific file ansible.posix.acl: path: /etc/foo.conf register: acl_info