puppetlabs-inifile icon indicating copy to clipboard operation
puppetlabs-inifile copied to clipboard

Add support for multi-line settings

Open webcompas opened this issue 8 months ago • 0 comments

Use Case

There are Ini-style config files which contain settings with multiple values. They are provided in a Heredoc style like in the following example excerpt of snmptt.ini:

snmptt_conf_files = <<END
/etc/snmp/snmptt.conf
/etc/snmp/snmptt.conf.vendor1
/etc/snmp/snmptt.conf.vendor2
END

Unfortunately managing such a setting is not yet supported.

Proposed solution

I'd like to get such multi-line settings supported. The delimiter to use (e.g. "END") should be customizable by a corresponding parameter. The solution could either make use of additional parameters to ini_setting or introduce a new type ( for example ini_setting_multiline).

Considered alternatives

Just serving the whole file is not suitable in my use case. I also tried to solve it using Augeas but there's no corresponding lens available.

webcompas avatar Jun 17 '24 12:06 webcompas