mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-12 15:45:20 +01:00
Fix module in order to don't show "changed" status when running ansible playbook with authorized_key module if keys are not different
This commit is contained in:
parent
6343dbdcff
commit
0d5458c6cc
1 changed files with 6 additions and 3 deletions
|
|
@ -618,9 +618,12 @@ def enforce_state(module, params):
|
|||
# for 'exclusive', make sure keys are written in the order the new keys were
|
||||
if state == "present" and exclusive:
|
||||
to_remove = frozenset(existing_keys).difference(keys_to_exist)
|
||||
if len(to_remove) != 0:
|
||||
for key in to_remove:
|
||||
del existing_keys[key]
|
||||
do_write = True
|
||||
else:
|
||||
do_write = False
|
||||
|
||||
if do_write:
|
||||
filename = keyfile(module, user, do_write, path, manage_dir, follow)
|
||||
|
|
|
|||
Loading…
Reference in a new issue