community.general
community.general copied to clipboard
to_ini: add support for no_extra_spaces parameter
Summary
It would be nice if the to_ini filter supported the optional keyword parameter no_extra_spaces in the same way as ini_file module does:
- Default to
falseto insert space characters before and after=in the resulting INI format output. This is the current behavior and also the default inini_filemodule. - Set to
trueto not insert space characters before and after=in the resulting INI format output.
The reason for this is that both formats are widely used in different INI files. With this option the module can cater to use cases in both formats and not impose a certain formatting on the resulting output.
Then the resulting output can be chosen according to formatting possibly imposed by third parties and not create a situation where there are always changed=true task(s) that just remove/add spaces around the = in files written by to_ini.
ini_file module help for this same parameter: https://docs.ansible.com/ansible/latest/collections/community/general/ini_file_module.html#parameter-no_extra_spaces
Issue Type
Feature Idea
Component Name
to_ini
Additional Information
Code of Conduct
- [X] I agree to follow the Ansible Code of Conduct