ansible / ansible.builtin / v2.5.11 / module / xattr Manage user defined extended attributes | "added in version" 1.3 of ansible.builtin" Authors: Brian Coca (@bcoca) stableinterface | supported by communityansible.builtin.xattr (v2.5.11) — module
pip
Install with pip install ansible==2.5.11
Manages filesystem user defined extended attributes, requires that they are enabled on the target filesystem and that the setfattr/getfattr utilities are present.
- 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
key: description: - The name of a specific Extended attribute key to set/retrieve. path: aliases: - name description: - The full path of the file/object to get the facts of. - Before 2.3 this option was only usable as I(name). required: true state: choices: - absent - all - keys - present - read default: read description: - defines which state you want to do. C(read) retrieves the current value for a C(key) (default) C(present) sets C(name) to C(value), default if value is set C(all) dumps all data C(keys) retrieves all keys C(absent) deletes the key value: description: - The value to set the named name/key to, it automatically sets the C(state) to 'set'. follow: default: 'yes' description: - If C(yes), dereferences symlinks and sets/gets attributes on symlink target, otherwise acts on symlink itself. type: bool