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 +314,9 @@ Determines whether the specified setting should exist. Valid options: 'present'
207
314
208
315
##### `section_suffix`
209
316
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
-
317
+
*Optional.* Designates the string that will appear after the section's name. Default value: "]".
215
318
319
+
**NOTE:** This type finds all sections in the file by looking for lines like `${section_prefix}${title}${section_suffix}`.
216
320
217
321
### Type: ini_subsetting
218
322
@@ -248,7 +352,6 @@ Specifies whether the subsetting should be present. Valid options: 'present' and
248
352
249
353
*Required.* Designates a subsetting to manage within the specified setting. Valid options: a string.
250
354
251
-
252
355
##### `subsetting_separator`
253
356
254
357
*Optional.* Specifies a string to use between subsettings. Valid options: a string. Default value: " ".
@@ -257,142 +360,40 @@ Specifies whether the subsetting should be present. Valid options: 'present' and
257
360
258
361
*Optional.* Supplies a value for the specified subsetting. Valid options: a string. Default value: undefined.
259
362
260
-
261
-
262
-
263
363
### Function: create_ini_settings
264
364
265
-
`create_ini_settings($settings, $defaults)`
365
+
Manages multiple `ini_setting` resources from a hash. Note that this cannot be used with ini_subsettings.
266
366
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!
367
+
`create_ini_settings($settings, $defaults)`
268
368
269
-
#### Parameters
369
+
#### Arguments
270
370
271
-
##### `$settings`
371
+
##### First argument: `settings`
272
372
273
-
*Required.* Specify a hash with the ini_setting resources.
373
+
*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
389
Default value: '{}'.
333
390
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
391
##Limitations
389
392
390
393
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
394
392
395
##Development
393
396
394
-
#Development
395
-
396
397
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
398
398
399
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