community.general.xattr – Manage user defined extended attributes¶
Note
This plugin is part of the community.general collection (version 2.5.1).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.xattr
.
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¶
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
community.general.xattr:
path: /etc/foo.conf
- name: Set the key 'user.foo' to value 'bar'
community.general.xattr:
path: /etc/foo.conf
key: foo
value: bar
- name: Set the key 'trusted.glusterfs.volume-id' to value '0x817b94343f164f199e5b573b4ea1f914'
community.general.xattr:
path: /mnt/bricks/brick1
namespace: trusted
key: glusterfs.volume-id
value: "0x817b94343f164f199e5b573b4ea1f914"
- name: Remove the key 'user.foo'
community.general.xattr:
path: /etc/foo.conf
key: foo
state: absent
- name: Remove the key 'trusted.glusterfs.volume-id'
community.general.xattr:
path: /mnt/bricks/brick1
namespace: trusted
key: glusterfs.volume-id
state: absent
Authors¶
Brian Coca (@bcoca)