2018-01-09 06:31:17 +00:00
|
|
|
- name: Set attributes
|
|
|
|
xattr:
|
|
|
|
path: "{{ test_file }}"
|
|
|
|
key: user.foo
|
|
|
|
value: bar
|
|
|
|
register: xattr_set_result
|
|
|
|
|
|
|
|
- name: Get attributes
|
|
|
|
xattr:
|
|
|
|
path: "{{ test_file }}"
|
|
|
|
register: xattr_get_all_result
|
|
|
|
|
|
|
|
- name: Get specific attribute
|
|
|
|
xattr:
|
|
|
|
path: "{{ test_file }}"
|
2018-07-16 17:26:06 +00:00
|
|
|
key: foo
|
2018-01-09 06:31:17 +00:00
|
|
|
register: xattr_get_specific_result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "xattr_set_result.changed"
|
|
|
|
- "xattr_get_all_result['xattr']['user.foo'] == 'bar'"
|
|
|
|
- "not xattr_get_all_result.changed"
|
|
|
|
- "xattr_get_specific_result['xattr']['user.foo'] == 'bar'"
|
|
|
|
- "not xattr_get_specific_result.changed"
|
|
|
|
|
|
|
|
- name: Set attribute again
|
|
|
|
xattr:
|
|
|
|
path: "{{ test_file }}"
|
2018-07-16 17:26:06 +00:00
|
|
|
namespace: user
|
|
|
|
key: foo
|
2018-01-09 06:31:17 +00:00
|
|
|
value: bar
|
|
|
|
register: xattr_set_again_result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "not xattr_set_again_result.changed"
|
|
|
|
|
|
|
|
- name: Unset attribute
|
|
|
|
xattr:
|
|
|
|
path: "{{ test_file }}"
|
2018-07-16 17:26:06 +00:00
|
|
|
key: foo
|
2018-01-09 06:31:17 +00:00
|
|
|
state: absent
|
|
|
|
register: xattr_unset_result
|
|
|
|
|
2018-07-16 17:26:06 +00:00
|
|
|
- name: Get attributes
|
2018-01-09 06:31:17 +00:00
|
|
|
xattr:
|
|
|
|
path: "{{ test_file }}"
|
|
|
|
register: xattr_get_after_unset_result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "xattr_unset_result.changed"
|
|
|
|
- "xattr_get_after_unset_result['xattr'] == {}"
|
|
|
|
- "not xattr_get_after_unset_result.changed"
|
|
|
|
|
|
|
|
- name: Unset attribute again
|
|
|
|
xattr:
|
|
|
|
path: "{{ test_file }}"
|
2018-07-16 17:26:06 +00:00
|
|
|
namespace: user
|
|
|
|
key: foo
|
2018-01-09 06:31:17 +00:00
|
|
|
state: absent
|
|
|
|
register: xattr_unset_result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "not xattr_set_again_result.changed"
|