Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8394787
inisection.pp
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
inisection.pp
View Options
# == Define: icingaweb2::inifile
#
# Manage settings in INI configuration files.
#
# === Parameters
#
# [*section_name*]
# Name of the target section. Settings are set under [$section_name]
#
# [*target*]
# Absolute path to the configuration file.
#
# [*settings*]
# A hash of settings and their settings. Single settings may be set to absent.
#
# [*order*]
# Ordering of the INI section within a file. Defaults to `01`
#
# === Examples
#
# Create the configuration file '/path/to/config.ini' and set the settings 'setting1' and 'setting2' for the section
# 'global'
#
# include icingawebeb2
# icingaweb2::inifile {"/path/to/config.ini":
# settings => {
# 'global' => {
# 'setting1' => 'value',
# 'setting2' => 'value',
# },
# },
# }
#
define
icingaweb2
::
inisection
(
$target,
$section_name
=
$title,
$settings
=
{},
$order
=
'01'
,
){
$conf_user
=
$::icingaweb2::params::conf_user
$conf_group
=
$::icingaweb2::params::conf_group
validate_string
(
$section_name)
validate_absolute_path
(
$target)
validate_hash
(
$settings)
validate_string
(
$order)
if
!
defined
(
Concat
[
$target])
{
concat
{
$target:
ensure
=>
present
,
warn
=>
false
,
owner
=>
$conf_user,
group
=>
$conf_group,
mode
=>
'0640'
,
}
}
concat
::
fragment
{
$section_name:
target
=>
$target,
content
=>
template
(
'icingaweb2/inisection.erb'
),
order
=>
$order,
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Jun 4 2025, 7:29 PM (9 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3399200
Attached To
R118 Puppet module to manage Icinga Web 2
Event Timeline
Log In to Comment