- Docs »
- xattr - Manage user defined extended attributes
-
You are reading an unmaintained version of the Ansible documentation. Unmaintained Ansible versions can contain unfixed security vulnerabilities (CVE). Please upgrade to a maintained version. See the latest Ansible documentation.
xattr - Manage user defined extended attributes
- Manages filesystem user defined extended attributes, requires that they are enabled on the target filesystem and that the setfattr/getfattr utilities are present.
Parameter |
Choices/Defaults |
Comments |
follow
bool |
|
If yes , dereferences symlinks and sets/gets attributes on symlink target, otherwise acts on symlink itself.
|
key
|
|
The name of a specific Extended attribute key to set/retrieve.
|
path
required |
|
The full path of the file/object to get the facts of.
Before 2.3 this option was only usable as name.
aliases: name
|
state
|
Choices:
- absent
- all
- keys
- present
read ←
|
defines which state you want to do. read retrieves the current value for a key (default) present sets name to value , default if value is set all dumps all data keys retrieves all keys absent deletes the key
|
value
|
|
The value to set the named name/key to, it automatically sets the state to 'set'.
|
Note
- As of Ansible 2.3, the name option has been changed to path as default, but name still works as well.
- name: Obtain the extended attributes of /etc/foo.conf
xattr:
path: /etc/foo.conf
- name: Sets the key 'foo' to value 'bar'
xattr:
path: /etc/foo.conf
key: user.foo
value: bar
- name: Removes the key 'foo'
xattr:
path: /etc/foo.conf
key: user.foo
state: absent
This module is flagged as stableinterface which means that the maintainers for this module guarantee that no backward incompatible interface changes will be made.
This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.
For a list of other modules that are also maintained by the Ansible Community, see here.
Hint
If you notice any issues in this documentation you can edit this document to improve it.