New in version 1.3.
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.
|
|
namespace
(added in 2.7) |
Default: user
|
Namespace of the named name/key.
|
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 |
|
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
- 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
This module is flagged as stableinterface which means that the maintainers for this module guarantee that no backward incompatible interface changes will be made.
Hint
If you notice any issues in this documentation you can edit this document to improve it.