You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -207,12 +310,9 @@ Determines whether the specified setting should exist. Valid options: 'present'
207
310
208
311
##### `section_suffix`
209
312
210
-
*Optional.* Designates the string that will appear after the section's name. Default value: "]"
211
-
212
-
**NOTE:** The way this type finds all sections in the file is by looking for lines like `${section_prefix}${title}${section_suffix}`
213
-
214
-
313
+
*Optional.* Designates the string that will appear after the section's name. Default value: "]".
215
314
315
+
**NOTE:** This type finds all sections in the file by looking for lines like `${section_prefix}${title}${section_suffix}`.
216
316
217
317
### Type: ini_subsetting
218
318
@@ -248,7 +348,6 @@ Specifies whether the subsetting should be present. Valid options: 'present' and
248
348
249
349
*Required.* Designates a subsetting to manage within the specified setting. Valid options: a string.
250
350
251
-
252
351
##### `subsetting_separator`
253
352
254
353
*Optional.* Specifies a string to use between subsettings. Valid options: a string. Default value: " ".
@@ -257,142 +356,40 @@ Specifies whether the subsetting should be present. Valid options: 'present' and
257
356
258
357
*Optional.* Supplies a value for the specified subsetting. Valid options: a string. Default value: undefined.
259
358
260
-
261
-
262
-
263
359
### Function: create_ini_settings
264
360
265
-
`create_ini_settings($settings, $defaults)`
361
+
Manages multiple `ini_setting` resources from a hash. Note that this cannot be used with ini_subsettings.
266
362
267
-
Manage multiple ini_setting resources from a hash with comfort. You can provide a hash in your manifest and feed it from Hiera. This can however not be used with ini_subsettings!
363
+
`create_ini_settings($settings, $defaults)`
268
364
269
-
#### Parameters
365
+
#### Arguments
270
366
271
-
##### `$settings`
367
+
##### First argument: `settings`
272
368
273
-
*Required.* Specify a hash with the ini_setting resources.
369
+
*Required.* Specify a hash representing the `ini_setting` resources you want to create.
This most certainly is not what you want, but if you need it it's there.
331
-
332
385
Default value: '{}'.
333
386
334
-
#### Example with Hiera
335
-
This example will need Puppet 3.x/4.x as it uses automatic retrieval of Hiera data for class parameters and
336
-
`puppetlabs/stdlib` (you use that one already, don't you?).
337
-
338
-
Of course you may use `hiera_hash` when on Puppet 2.x or other use cases. Remember this is only one example,
339
-
feel free to live your creativity on writing manifests.
340
-
341
-
Imagine a profile `example`:
342
-
~~~
343
-
class profile::example (
344
-
$settings,
345
-
) {
346
-
validate_hash($settings)
347
-
$defaults = { 'path' => '/tmp/foo.ini' }
348
-
create_ini_settings($settings, $defaults)
349
-
}
350
-
~~~
351
-
352
-
Now provide this in your Hiera data:
353
-
~~~
354
-
profile::example::settings:
355
-
section1:
356
-
setting1: value1
357
-
setting2: value2
358
-
setting3:
359
-
ensure: absent
360
-
~~~
361
-
362
-
This will result in resources:
363
-
~~~
364
-
ini_setting { '[section1] setting1':
365
-
ensure => present,
366
-
section => 'section1',
367
-
setting => 'setting1',
368
-
value => 'value1',
369
-
path => '/tmp/foo.ini',
370
-
}
371
-
ini_setting { '[section1] setting2':
372
-
ensure => present,
373
-
section => 'section1',
374
-
setting => 'setting2',
375
-
value => 'value2',
376
-
path => '/tmp/foo.ini',
377
-
}
378
-
ini_setting { '[section1] setting3':
379
-
ensure => absent,
380
-
section => 'section1',
381
-
setting => 'setting3',
382
-
path => '/tmp/foo.ini',
383
-
}
384
-
~~~
385
-
386
-
387
-
388
387
##Limitations
389
388
390
389
This module has been tested on [all PE-supported platforms](https://forge.puppetlabs.com/supported#compat-matrix), and no issues have been identified. Additionally, it is tested (but not supported) on Windows 7, Mac OS X 10.9, and Solaris 12.
391
390
392
391
##Development
393
392
394
-
#Development
395
-
396
393
Puppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We can't access the huge number of platforms and myriad of hardware, software, and deployment configurations that Puppet is intended to serve.
397
394
398
395
We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.
0 commit comments