* Insert_type and insert value can define where
a new subsetting element will be placed.
* subsetting_key_val_separator allows you to have
a separator character between a subsetting name
and its value.
* Refactor ini_subsetting and its spec.
Working with a recent customer, they had a product whose ini files have timestamps in them associated with particular settings. When those settings are updated, it is expected that the timestamp be updated as well. To do this with ini_setting, we need it to respond to refresh events and have a way of only updating a value if a refresh event occurs. Hence the little modification to make this possible.
PR #156 merged a base class called `inifile` that dynamically queried
hiera using explicit `hiera_hash()` functions and required functions
from stdlib.
It is an anti-pattern for component classes to contain hiera
functions (even ones that do not trigger under all circumstances) as
this leads to tight-coupling with hiera data structures. It also
promotes the anti-pattern of declaring resources directly in hiera.
Also, inifile is not going to receive a major version increase for a
while (we hope) and so adding a dependency is not desirable at this
point.
Unfortunately this feedback was missed while reviewing the original PR,
so it has to be reverted.
Empty sections hanging around are not useful, so if the last line in a
section is removed then remove the section. If the section still has
comments, then just leave it be.
This does not add the ability to remove sections that do not have
settings to begin with; only allows cleaning a file as puppet makes
changes to it.
Puppet 4.0 and 4.1 are affected by PUP-4709 which raises duplicate
resource errors when using create_ini_settings(), due to the inclusion
of square brackets in the resource titles.
Error while evaluating a Function Call, Duplicate
declaration: Ini_setting[[foo] bar] is already declared; cannot
redeclare
Removing these from the function allows it to work on these Puppet
versions without error.
type file
show_diff => true (default) prints diff to logs
show_diff => md5 prints only md5 hashes instead of actual values
show_diff => false redacts any information about values
Global show_diff config takes priotiry over this one.
This added functionality allows you to specify hashes for ini_setting
and ini_subsetting so that they might be stored in Hiera. Without this
patch, you need to use ini_setting and ini_subsetting resources strictly
in code whereas with this patch, you could describe this in Hiera.
Update descriptions of the `section` parameter and the `setting`
parameter in `ini_setting` to match the descriptions in
`ini_subsetting`. Commit af78845 erroneously updated the README
description for the `setting` parameter with a description intended for
the `section` parameter.