acl – Set and retrieve file ACL information¶
Parameters¶
Notes¶
Note
The
acl
module requires that ACLs are enabled on the target filesystem and that thesetfacl
andgetfacl
binaries 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.
Examples¶
- name: Grant user Joe read access to a file
acl:
path: /etc/foo.conf
entity: joe
etype: user
permissions: r
state: present
- name: Removes the ACL for Joe on a specific file
acl:
path: /etc/foo.conf
entity: joe
etype: user
state: absent
- name: Sets default ACL for joe on /etc/foo.d/
acl:
path: /etc/foo.d/
entity: joe
etype: user
permissions: rw
default: yes
state: present
- name: Same as previous but using entry shorthand
acl:
path: /etc/foo.d/
entry: default:user:joe:rw-
state: present
- name: Obtain the ACL for a specific file
acl:
path: /etc/foo.conf
register: acl_info
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
acl
list
|
success |
Current ACL on provided path (after changes, if any)
Sample:
['user::rwx', 'group::rwx', 'other::rwx']
|
Status¶
This module is guaranteed to have backward compatible interface changes going forward. [stableinterface]
This module is maintained by the Ansible Core Team. [core]
Red Hat Support¶
More information about Red Hat’s support of this module is available from this Red Hat Knowledge Base article.
Authors¶
Brian Coca (@bcoca)
Jérémie Astori (@astorije)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.