mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-31 05:19:09 -07:00
[PR #8452/2a3819a6 backport][stable-9] git_config: fix state=absent if value is present (#8466)
git_config: fix state=absent if value is present (#8452)
* Fix state=absent if value is present.
* Update changelog fragment.
(cherry picked from commit 2a3819a696
)
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
f7df19adbd
commit
b3037a46be
3 changed files with 27 additions and 1 deletions
|
@ -252,7 +252,7 @@ def main():
|
|||
module.exit_json(changed=False, msg='', config_value=old_values[0] if old_values else '')
|
||||
elif unset and not out:
|
||||
module.exit_json(changed=False, msg='no setting to unset')
|
||||
elif new_value in old_values and (len(old_values) == 1 or add_mode == "add"):
|
||||
elif new_value in old_values and (len(old_values) == 1 or add_mode == "add") and not unset:
|
||||
module.exit_json(changed=False, msg="")
|
||||
|
||||
# Until this point, the git config was just read and in case no change is needed, the module has already exited.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue