Hi,
I have written confparser module ( https://github.com/ritzk/ansible-modules-extras-confparse ) as a replacement for ini_file. Do let me know, if anyone finds this useful and what I need to add/remove .
Thanks
Hi,
I have written confparser module ( https://github.com/ritzk/ansible-modules-extras-confparse ) as a replacement for ini_file. Do let me know, if anyone finds this useful and what I need to add/remove .
Thanks
I have had a PR in to fix the limitations of ini_file for some time now. https://github.com/ansible/ansible-modules-core/pull/1038
The problem is apparently that no one has time to review it, and they haven’t taken me up on my offer to provide a test suite for it.
Chris
Hi
This still uses ConfigParser, which requires a section header. This can be worked out by inserting a dummy header - https://stackoverflow.com/questions/2819696/parsing-properties-file-in-python/2819788#2819788 .
My reasons for confparser
It dumps the configurations out as a readable dictionary, which I use for executing different yml file
It deals mostly with unix style configuration ( ifcfg/zabbix configs/…) which lack section header.
Cheers
-ritz