-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breaking change in ini_file removes comments #7297
Comments
Files identified in the description: If these files are incorrect, please update the |
This is a result of #6575. As you can see in the discussion of that PR, depending on how the module was used it was already doing that before, and that behavior got broken at some point, so this change was in fact reverting an earlier breaking change. If someone wants to implement that, it would probably be good to be able to configure the behavior, since both behaviors (using 'commented-out' options, or keeping them) have both good reasons for and against. |
@felixfontein I've made a PR (#7401) to make this a configurable option. @rightaway please confirm if this is what you were looking for. |
Yes but please make modify_inactive_option false as default. It worked that way for years and most people have probably not noticed yet that it changed because it was so recent and are expecting old behavior. The recent change was breaking and it needs to go back to original to prevent destroying original configuration for thousands of files. |
For the reason explained above (#7297 (comment)) the behavior it has now was intended for a long time, so it should not be disabled by default. |
@rightaway While I sort of agree with you that #6575 might be a breaking change (even though it was a fix of a breaking change), this has already undergone two 'breaking changes', making a third one will make things even worse IMO, especially considering that it's been half a year since then, so it's not a bug fix anymore. |
Can a global option be added to ansible config so it doesn't need to be updated in thousands of places and many repositories without destroying original configuration? |
No, there's no way to configure something like that for modules, but you can use module defaults to set that option for a play. |
Default should never be something destructive that loses information. Merge was hasty. Is there RFC process for community to discuss these things for future breaking changes? |
The process of proposing changes to a module is a Pull Request on GitHub. If you want to be informed for new PRs for the |
Summary
Setting
option: opt
andvalue: value
now removes a line matching it with a comment.If the file has a description like this the whole
# opt: val
line will be removed. It's new breaking behavior. Not good because the removed line can be useful documentation.Issue Type
Bug Report
Component Name
ini_file
Ansible Version
Community.general Version
$ ansible-galaxy collection list community.general
Configuration
$ ansible-config dump --only-changed
OS / Environment
No response
Steps to Reproduce
Expected Results
Doesn't remove the line.
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: