mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-06-09 18:15:54 +00:00
acl: correctly assert needed changes when recursive is true
SUMMARY
Right now, when setting recursive ACLs on a directory, all files in the directory are tested to check if a change is needed. If a single file has expected ACLs already set, then the test returns False and no changes are applied.
Fixes #592
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
acl
ADDITIONAL INFORMATION
I'm very much a beginner in Python, so any criticism is welcome.
Reviewed-by: Hideki Saito <saito@fgrep.org>
(cherry picked from commit c4b1c2b0fb)
Co-authored-by: centosinfra-prod-github-app[bot] <161850885+centosinfra-prod-github-app[bot]@users.noreply.github.com>
24 lines
791 B
YAML
24 lines
791 B
YAML
---
|
|
# (c) 2017, Martin Krizek <mkrizek@redhat.com>
|
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
|
|
- name: Test ACL
|
|
vars:
|
|
test_user: ansible_user
|
|
test_group: ansible_group
|
|
test_file: "{{ output_dir }}/ansible file"
|
|
test_dir: "{{ output_dir }}/ansible_dir/with some space"
|
|
test_recursive_dir: "{{ output_dir }}/recursive_dir"
|
|
block:
|
|
- name: Include tests task file
|
|
ansible.builtin.include_tasks: acl.yml
|
|
when: ansible_system == 'Linux' # TODO enable acls mount option on FreeBSD to test it there too
|
|
always:
|
|
- name: Delete created directory and file
|
|
ansible.builtin.file:
|
|
path: "{{ item }}"
|
|
state: absent
|
|
with_items:
|
|
- "{{ test_dir }}"
|
|
- "{{ test_file }}"
|