xattr – Manage user defined extended attributes
xattr – Manage user defined extended attributes
Synopsis
- Manages filesystem user defined extended attributes.
- Requires that extended attributes are enabled on the target filesystem and that the setfattr/getfattr utilities are present.
Parameters
Parameter | Choices/Defaults | Comments |
---|---|---|
follow boolean |
|
If |
key string |
The name of a specific Extended attribute key to set/retrieve. | |
namespace string added in 2.7 |
Default: "user" |
Namespace of the named name/key. |
path path / required |
The full path of the file/object to get the facts of. Before 2.3 this option was only usable as name.
| |
state string |
|
defines which state you want to do. |
value string |
The value to set the named name/key to, it automatically sets the |
Notes
Note
- As of Ansible 2.3, the name option has been changed to path as default, but name still works as well.
Examples
- name: Obtain the extended attributes of /etc/foo.conf
xattr:
path: /etc/foo.conf
- name: Set the key 'user.foo' to value 'bar'
xattr:
path: /etc/foo.conf
key: foo
value: bar
- name: Set the key 'trusted.glusterfs.volume-id' to value '0x817b94343f164f199e5b573b4ea1f914'
xattr:
path: /mnt/bricks/brick1
namespace: trusted
key: glusterfs.volume-id
value: "0x817b94343f164f199e5b573b4ea1f914"
- name: Remove the key 'user.foo'
xattr:
path: /etc/foo.conf
key: foo
state: absent
- name: Remove the key 'trusted.glusterfs.volume-id'
xattr:
path: /mnt/bricks/brick1
namespace: trusted
key: glusterfs.volume-id
state: absent
Status
- This module is guaranteed to have backward compatible interface changes going forward. [stableinterface]
- This module is maintained by the Ansible Community. [community]
Authors
- Brian Coca (@bcoca)
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.9/modules/xattr_module.html