mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-17 22:01:07 -07:00
* don't report changed when nothing is removed
* add change log
* linter happy
* Update plugins/modules/files/ini_file.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update changelogs/fragments/4154-ini_file_changed.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* add absent idempotency test
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit f527bb61f9
)
Co-authored-by: James Livulpi <james.livulpi@me.com>
This commit is contained in:
parent
b1459b13fe
commit
f8842e39be
3 changed files with 14 additions and 3 deletions
|
@ -367,9 +367,10 @@ def do_ini(module, filename, section=None, option=None, values=None,
|
|||
section_lines = new_section_lines
|
||||
else:
|
||||
# drop the entire section
|
||||
section_lines = []
|
||||
msg = 'section removed'
|
||||
changed = True
|
||||
if section_lines:
|
||||
section_lines = []
|
||||
msg = 'section removed'
|
||||
changed = True
|
||||
|
||||
# reassemble the ini_lines after manipulation
|
||||
ini_lines = before + section_lines + after
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue