Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9340894
timeperiod.pp
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
timeperiod.pp
View Options
# == Define: icinga2::object::timeperiod
#
# Manage Icinga 2 timeperiod objects.
#
# === Parameters
#
# [*ensure*]
# Set to present enables the object, absent disables it. Defaults to present.
#
# [*timeperiod_name*]
# Set the Icinga 2 name of the timeperiod object. Defaults to title of the define resource.
#
# [*display_name*]
# A short description of the time period.
#
# [*import*]
# Sorted List of templates to include. Defaults to [ "legacy-timeperiod" ].
#
# [*ranges*]
# A dictionary containing information which days and durations apply to this
# timeperiod.
#
# [*prefer_includes*]
# Boolean whether to prefer timeperiods includes or excludes. Default to true.
#
# [*excludes*]
# An array of timeperiods, which should exclude from your timerange.
#
# [*includes*]
# An array of timeperiods, which should include into your timerange
#
# [*template*]
# Set to true creates a template instead of an object. Defaults to false.
#
# [*target*]
# Destination config file to store this object in. File will be declared on the first run.
#
# [*order*]
# String or integer to control the position in the target file, sorted alpha numeric. Defaults to 35.
#
#
define
icinga2
::
object
::
timeperiod
(
Stdlib
::
Absolutepath
$target,
Enum
[
'absent'
,
'present'
]
$ensure
=
present
,
String
$timeperiod_name
=
$title,
Optional
[
String
]
$display_name
=
undef
,
Optional
[
Hash
]
$ranges
=
undef
,
Optional
[
Boolean
]
$prefer_includes
=
undef
,
Optional
[
Array
]
$excludes
=
undef
,
Optional
[
Array
]
$includes
=
undef
,
Boolean
$template
=
false
,
Array
$import
=
[
'legacy-timeperiod'
],
Variant
[
String
,
Integer
]
$order
=
35
,
){
# compose attributes
$attrs
=
{
'display_name'
=>
$display_name,
'ranges'
=>
$ranges,
'prefer_includes'
=>
$prefer_includes,
'excludes'
=>
$excludes,
'includes'
=>
$includes,
}
# create object
icinga2
::
object
{
"icinga2::object::TimePeriod::${title}"
:
ensure
=>
$ensure,
object_name
=>
$timeperiod_name,
object_type
=>
'TimePeriod'
,
template
=>
$template,
import
=>
$import,
attrs
=>
delete_undef_values
(
$attrs),
attrs_list
=>
keys
(
$attrs),
target
=>
$target,
order
=>
$order,
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 4, 11:18 AM (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3300237
Attached To
rSPICI Icinga 2 Puppet Module
Event Timeline
Log In to Comment