mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-06-11 10:35:34 +00:00
When state=present and exclusive=true, the cleanup loops in do_ini()
treated any line that contained the option name as a match, including
pure documentation comments such as "; output_buffering" that have no
"=" sign. As a result those lines were either rewritten in place or
deleted, even though they are not configuration entries.
Skip lines where match.group(2) is a comment character ("#" or ";") and
match.group(6) is empty (no "=" present). This keeps the existing
behaviour of replacing commented config lines like ";output_buffering = 4096"
when modify_inactive_option=true, while leaving doc comments untouched.
Adds two regression tests covering the exact scenario from the issue and
the simpler commented-config replacement case.
Fixes: https://github.com/ansible-collections/community.general/issues/11919
|
||
|---|---|---|
| .. | ||
| become | ||
| cache | ||
| callback | ||
| connection | ||
| filter | ||
| inventory | ||
| lookup | ||
| module_utils | ||
| modules | ||
| plugin_utils | ||