Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9696265
entry.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
entry.pp
View Options
define
puppet
::
config
::
entry
(
$key,
$value,
$section,
$sectionorder
=
5
,
$joiner
=
','
,
)
{
if
is_array
(
$value)
{
$_value
=
join
(
flatten
(
$value),
$joiner)
}
elsif
is_bool
(
$value)
{
$_value
=
bool2str
(
$value)
}
else
{
$_value
=
$value
}
# note the spaces at he end of the 'order' parameters,
# they make sure that '1_main ' is ordered before '1_main_*'
ensure_resource
(
'concat::fragment'
,
"puppet.conf_${section}"
,
{
target
=>
"${::puppet::dir}/puppet.conf"
,
content
=>
"\n\n[${section}]"
,
order
=>
"${sectionorder}_${section} "
,
})
# this adds the '$key =' for the first value,
# otherwise it just appends it with the joiner to separate it from the previous value.
if
(
!
defined
(
Concat
::
Fragment
[
"puppet.conf_${section}_${key}"
])){
concat
::
fragment
{
"puppet.conf_${section}_${key}"
:
target
=>
"${::puppet::dir}/puppet.conf"
,
content
=>
"\n ${key} = ${_value}"
,
order
=>
"${sectionorder}_${section}_${key} "
,
}
}
else
{
concat
::
fragment
{
"puppet.conf_${section}_${key}_${name}"
:
target
=>
"${::puppet::dir}/puppet.conf"
,
content
=>
"${joiner}${_value}"
,
order
=>
"${sectionorder}_${section}_${key}_${name} "
,
}
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Aug 18, 7:37 PM (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3460123
Attached To
rSPPUP puppet-theforeman-puppet
Event Timeline
Log In to Comment