create_ini_settings is a function that allows you to create
ini_setting resources from a simple hash:
$settings = { section1 => {
setting1 => val1
},
section2 => {
setting2 => val2,
setting3 => {
ensure => absent
}
}
}
$defaults = {
path => '/tmp/foo.ini'
}
create_ini_settings($settings,$defaults)
Will create the following resources
ini_setting{'[section1] setting1':
ensure => present,
section => 'section1',
setting => 'setting1',
value => 'val1',
path => '/tmp/foo.ini',
}
ini_setting{'[section2] setting2':
ensure => present,
section => 'section2',
setting => 'setting2',
value => 'val2',
path => '/tmp/foo.ini',
}
ini_setting{'[section2] setting3':
ensure => absent,
section => 'section2',
setting => 'setting3',
path => '/tmp/foo.ini',
}
This allows one to create much easier classes
that should be able to manage an arbritary set of
ini-style settings without having to specify each
one of them.
Noticed this when I was testing the module out with a FreeBSD host this code duplicates the shared_example used in the rest of the spec, so I DRY'd it up! 👍
We have many ini-style configuration files which use : as key value
separator. We'd like to be able to manage them with ini_setting as well.
This here is a naïve first attempt in that direction.
Please note that despite the fact that this *should* match, it's failing
unit tests.. This is a work in progress.
The puppet_facts gem implicitly depends on the json gem.
On Ruby 1.8.7, json is not built in. On Puppet 2.7, it is
not explicitly pulled in by the hiera gem. So we add it
here explicitly.
Added a warning about old, manually installed inifile modules cause failure of agent runs on master as of PE 3.3. User needs to update inifile module.
Bonus round: DOC-1267. Corrected a broken link in the contributor section.
Summary
This supported bugfix release corrects the inifile section header
detection regex (so you can use more characters in your section titles).
Bugfixes
- Correct section regex to allow anything other than ]
- Correct `exists?` to return a boolean
- Lots of test updates
- Add missing CONTRIBUTING.md