mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-11 07:05:27 +01:00
fix(acl): correctly assert needed changes when recursive is true
This commit is contained in:
parent
1994b2cf1c
commit
392fd0deaa
2 changed files with 9 additions and 1 deletions
2
changelogs/fragments/638_fix_recursive_acl.yml
Normal file
2
changelogs/fragments/638_fix_recursive_acl.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- acl - correctly assert needed changes when pointing to a directory and recursive is set to true.
|
||||||
|
|
@ -243,13 +243,19 @@ def acl_changed(module, cmd, entry, use_nfsv4_acls=False):
|
||||||
cmd.insert(1, '--test')
|
cmd.insert(1, '--test')
|
||||||
lines = run_acl(module, cmd)
|
lines = run_acl(module, cmd)
|
||||||
counter = 0
|
counter = 0
|
||||||
|
lines_checked = 0
|
||||||
|
lines_unchanged = 0
|
||||||
for line in lines:
|
for line in lines:
|
||||||
|
lines_checked += 1
|
||||||
if line.endswith('*,*') and not use_nfsv4_acls:
|
if line.endswith('*,*') and not use_nfsv4_acls:
|
||||||
return False
|
lines_unchanged += 1
|
||||||
# if use_nfsv4_acls and entry is listed
|
# if use_nfsv4_acls and entry is listed
|
||||||
if use_nfsv4_acls and entry == line:
|
if use_nfsv4_acls and entry == line:
|
||||||
counter += 1
|
counter += 1
|
||||||
|
|
||||||
|
if lines_unchanged == lines_checked:
|
||||||
|
return False
|
||||||
|
|
||||||
# The current 'nfs4_setfacl --test' lists a new entry,
|
# The current 'nfs4_setfacl --test' lists a new entry,
|
||||||
# which will be added at the top of list, followed by the existing entries.
|
# which will be added at the top of list, followed by the existing entries.
|
||||||
# So if the entry has already been registered, the entry should be find twice.
|
# So if the entry has already been registered, the entry should be find twice.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue