From 229171c9e9a6a4537fa36cca53e01efee7aa9b1d Mon Sep 17 00:00:00 2001 From: Lennart Betz Date: Thu, 13 Sep 2018 15:17:17 +0200 Subject: [PATCH] fix #451 Parameter order of concat resource has to be a string --- README.md | 87 +++++++------------------ manifests/config/fragment.pp | 10 +-- manifests/feature/api.pp | 2 +- manifests/feature/checker.pp | 2 +- manifests/feature/command.pp | 2 +- manifests/feature/compatlog.pp | 2 +- manifests/feature/debuglog.pp | 2 +- manifests/feature/elasticsearch.pp | 2 +- manifests/feature/gelf.pp | 2 +- manifests/feature/graphite.pp | 2 +- manifests/feature/idomysql.pp | 2 +- manifests/feature/idopgsql.pp | 2 +- manifests/feature/influxdb.pp | 2 +- manifests/feature/livestatus.pp | 2 +- manifests/feature/mainlog.pp | 2 +- manifests/feature/notification.pp | 2 +- manifests/feature/opentsdb.pp | 2 +- manifests/feature/perfdata.pp | 2 +- manifests/feature/statusdata.pp | 2 +- manifests/feature/syslog.pp | 2 +- manifests/object.pp | 30 ++++----- manifests/object/apiuser.pp | 16 ++--- manifests/object/checkcommand.pp | 4 +- manifests/object/checkresultreader.pp | 14 ++-- manifests/object/compatlogger.pp | 14 ++-- manifests/object/dependency.pp | 42 ++++++------ manifests/object/endpoint.pp | 16 ++--- manifests/object/eventcommand.pp | 4 +- manifests/object/host.pp | 4 +- manifests/object/hostgroup.pp | 18 ++--- manifests/object/notification.pp | 48 +++++++------- manifests/object/notificationcommand.pp | 4 +- manifests/object/scheduleddowntime.pp | 34 +++++----- manifests/object/service.pp | 4 +- manifests/object/servicegroup.pp | 20 +++--- manifests/object/timeperiod.pp | 24 +++---- manifests/object/user.pp | 4 +- manifests/object/usergroup.pp | 22 +++---- manifests/object/zone.pp | 16 ++--- 39 files changed, 215 insertions(+), 256 deletions(-) diff --git a/README.md b/README.md index 922704fd8..526e3db41 100644 --- a/README.md +++ b/README.md @@ -763,12 +763,12 @@ icinga2::object::service { 'load': check_command => 'load', assign => ['vars.os == Linux'], target => '/etc/icinga2/conf.d/service_load.conf', - order => '30', + order => 30, } icinga2::config::fragment { 'load-function': target => '/etc/icinga2/conf.d/service_load.conf', - order => '10', + order => 10, content => 'vars.load_wload1 = {{ if (get_time_period("backup").is_inside) { return 20 @@ -817,11 +817,11 @@ icinga2::config::fragment { 'load-function': - [Defined type: icinga2::object::dependency](#defined-type-icinga2objectdependency) - [Defined type: icinga2::object::timeperiod](#defined-type-icinga2objecttimeperiod) - [Defined type: icinga2::object::usergroup](#defined-type-icinga2objectusergroup) + - [Defined type: icinga2::object::user](#defined-type-icinga2objectuser) - [Defined type: icinga2::object::notificationcommand](#defined-type-icinga2objectnotificationcommand) - [Defined type: icinga2::object::notification](#defined-type-icinga2objectnotification) - [Defined type: icinga2::object::service](#defined-type-icinga2objectservice) - [Defined type: icinga2::object::servicegroup](#defined-type-icinga2objectservicegroup) - - [Defined type: icinga2::object::downtime](#defined-type-icinga2objectdowntime) - [Defined type: icinga2::object::scheduleddowntime](#defined-type-icinga2objectscheduleddowntime) - [Defined type: icinga2::object::eventcommand](#defined-type-icinga2objecteventcommand) - [Defined type: icinga2::object::checkresultreader](#defined-type-icinga2objectcheckresultreader) @@ -1585,7 +1585,7 @@ like `10m` for 10 minutes or `1h` for one hour. Destination config file to store in this object. File will be declared at the first time. ##### `order` -String to set the position in the target file, sorted alpha numeric. Defaults to `10`. +String or integer to set the position in the target file, sorted alpha numeric. Defaults to 40. #### Defined type: `icinga2::object::zone` @@ -1608,7 +1608,7 @@ If set to `true`, a global zone is defined and the parameter endpoints and paren Destination config file to store in this object. File will be declared at the first time. ##### `order` -String to control the position in the target file, sorted alpha numeric. +String or integer to control the position in the target file, sorted alpha numeric. Defauts to 45. #### Defined type: `icinga2::object::apiuser` @@ -1632,7 +1632,7 @@ as function. Destination config file to store in this object. File will be declared at the first time. ##### `order` -String to control the position in the target file, sorted alpha numeric. Defaults to `10` +String or integer to control the position in the target file, sorted alpha numeric. Defaults to 30. ###### Examples @@ -1690,7 +1690,7 @@ Destination config file to store in this object. File will be declared the first time. ##### `order` -String to set the position in the target file, sorted alpha numeric. Defaults to `10` +String or integer to set the position in the target file, sorted alpha numeric. Defaults to 15. #### Defined type: `icinga2::object::host` @@ -1791,7 +1791,7 @@ Set to true creates a template instead of an object. Defaults to `false` Destination config file to store in this object. File will be declared the first time. ##### `order` -String to set the position in the target file, sorted alpha numeric. Defaults to `10` +String or integer to set the position in the target file, sorted alpha numeric. Defaults to 50. #### Defined type: `icinga2::object::hostgroup` @@ -1811,7 +1811,7 @@ Assign host group members using the group assign rules. Destination config file to store in this object. File will be declared at the first time. ##### `order` -String to set the position in the target file, sorted alpha numeric. Defaults to `10` +String or integer to set the position in the target file, sorted alpha numeric. Defaults to 55. #### Defined type: `icinga2::object::dependency` @@ -1874,7 +1874,7 @@ Sorted List of templates to include. Defaults to an empty list. Destination config file to store in this object. File will be declared the first time. ##### `order` -String to set the position in the target file, sorted alpha numeric. Defaults to `35` +String or integer to set the position in the target file, sorted alpha numeric. Defaults to 70. #### Defined type: `icinga2::object::timeperiod` @@ -1909,7 +1909,7 @@ Set to true creates a template instead of an object. Defaults to `false` Destination config file to store this object in. File will be declared on the first run. ##### `order` -String to control the position in the target file, sorted alpha numeric. +String or integer to control the position in the target file, sorted alpha numeric. Defaults to 35. #### Defined type: `icinga2::object::usergroup` @@ -1944,7 +1944,7 @@ Sorted List of templates to include. Defaults to an empty list. Destination config file to store in this object. File will be declared the first time. ##### `order` -String to set the position in the target file, sorted alpha numeric. Defaults to `10` +String or integer to set the position in the target file, sorted alpha numeric. Defaults to 80. #### Defined type: `icinga2::object::user` @@ -1988,7 +1988,7 @@ Sorted List of templates to include. Defaults to an empty list. Destination config file to store in this object. File will be declared the first time. ##### `order` -String to set the position in the target file, sorted alpha numeric. Defaults to `30` +String or integer to set the position in the target file, sorted alpha numeric. Defaults to 75. #### Defined type: `icinga2::object::notificationcommand` @@ -2028,7 +2028,7 @@ Sorted List of templates to include. Defaults to an empty list. Destination config file to store in this object. File will be declared the first time. ##### `order` -String to set the position in the target file, sorted alpha numeric. Defaults to `10` +String or integer to set the position in the target file, sorted alpha numeric. Defaults to 25. #### Defined type: `icinga2::object::notification` @@ -2096,7 +2096,7 @@ Sorted List of templates to include. Defaults to an empty list. Destination config file to store in this object. File will be declared the first time. ##### `order` -String to set the position in the target file, sorted alpha numeric. Defaults to `10` +String or integer to set the position in the target file, sorted alpha numeric. Defaults to 85. #### Defined type: `icinga2::object::service` @@ -2213,7 +2213,7 @@ Sorted List of templates to include. Defaults to an empty list. Destination config file to store in this object. File will be declared the first time. ##### `order` -String to set the position in the target file, sorted alpha numeric. Defaults to `10` +String or integer to set the position in the target file, sorted alpha numeric. Defaults to 60. #### Defined type: `icinga2::object::servicegroup` @@ -2245,48 +2245,7 @@ Sorted List of templates to include. Defaults to an empty list. Destination config file to store in this object. File will be declared the first time. ##### `order` -String to set the position in the target file, sorted alpha numeric. Defaults to `30` - -#### Defined type: `icinga2::object::downtime` - -##### `ensure` -Set to present enables the downtime object, absent disables it. Defaults to `present` - -##### `host_name` -The name of the host this comment belongs to. - -##### `service_name` -The short name of the service this comment belongs to. If omitted, this comment object is treated as host comment. - -##### `author` -The author's name. - -##### `comment` -The comment text. - -##### `start_time` -The start time as unix timestamp. - -##### `end_time` -The end time as unix timestamp. - -##### `duration` -The duration as number. - -##### `entry_time` -The unix timestamp when this downtime was added. - -##### `fixed` -Whether the downtime is fixed (`true`) or flexible (`false`). Defaults to flexible. - -##### `triggers` -List of downtimes which should be triggered by this downtime. - -##### `target` -Destination config file to store in this object. File will be declared the first time. - -##### `order` -String to set the position in the target file, sorted alpha numeric. Defaults to `30` +String or integer to set the position in the target file, sorted alpha numeric. Defaults to 55. #### Defined type: `icinga2::object::scheduleddowntime` @@ -2337,7 +2296,7 @@ Exclude users using the group ignore rules. Destination config file to store in this object. File will be declared the first time. ##### `order` -String to set the position in the target file, sorted alpha numeric. Defaults to `30` +String or integer to set the position in the target file, sorted alpha numeric. Defaults to 90. #### Defined type: `icinga2::object::eventcommand` @@ -2374,7 +2333,7 @@ Destination config file to store in this object. File will be declared the first Sorted List of templates to include. Defaults to an empty list. ##### `order` -String to set the position in the target file, sorted alpha numeric. Defaults to `30` +String or integer to set the position in the target file, sorted alpha numeric. Defaults to 20. #### Defined type: `icinga2::object::checkresultreader` @@ -2391,7 +2350,7 @@ The directory which contains the check result files. Defaults to `LocalStateDir Destination config file to store in this object. File will be declared the first time. ##### `order` -String to set the position in the target file, sorted alpha numeric. Defaults to `30` +String or integer to set the position in the target file, sorted alpha numeric. Defaults to `05`. #### Defined type: `icinga2::object::compatlogger` @@ -2408,7 +2367,7 @@ The directory which contains the check result files. Defaults to `LocalStateDir Destination config file to store in this object. File will be declared the first time. ##### `order` -String to set the position in the target file, sorted alpha numeric. `Defaults to 30` +String or integer to set the position in the target file, sorted alpha numeric. Defaults to `05`. #### Defined type: `icinga2::config::fragment` @@ -2419,7 +2378,7 @@ Content to insert in file specified in target. Destination config file to store in this fragment. File will be declared the first time. ##### `order` -String to set the position in the target file, sorted in alpha numeric order. +String or integer to set the position in the target file, sorted in alpha numeric order. Defailts to `05`. ### Private defined types @@ -2467,7 +2426,7 @@ Icinga 2 object type for this object. Destination config file to store in this object. File will be declared the first time. ##### `order` -String to set the position in the target file, sorted alpha numeric. +String or integer to set the position in the target file, sorted alpha numeric. Defaults to 10. ## Development diff --git a/manifests/config/fragment.pp b/manifests/config/fragment.pp index 1f0d29d74..d57882d33 100644 --- a/manifests/config/fragment.pp +++ b/manifests/config/fragment.pp @@ -12,14 +12,14 @@ # first time. # # [*order*] -# String to set the position in the target file, sorted in alpha numeric order. +# String or integer to set the position in the target file, sorted in alpha numeric order. Defaults to `00`. # # define icinga2::config::fragment( - String $content, - Stdlib::Absolutepath $target, - String $code_name = $title, - Pattern[/^\d+$/] $order = '0', + String $content, + Stdlib::Absolutepath $target, + String $code_name = $title, + Variant[String, Integer] $order = '00', ) { include ::icinga2::params diff --git a/manifests/feature/api.pp b/manifests/feature/api.pp index b62f9268e..6b3b25c90 100644 --- a/manifests/feature/api.pp +++ b/manifests/feature/api.pp @@ -368,7 +368,7 @@ attrs => delete_undef_values($attrs), attrs_list => keys($attrs), target => "${conf_dir}/features-available/api.conf", - order => '10', + order => 10, notify => $_notify, } diff --git a/manifests/feature/checker.pp b/manifests/feature/checker.pp index 83d53d3a0..687eaa68e 100644 --- a/manifests/feature/checker.pp +++ b/manifests/feature/checker.pp @@ -38,7 +38,7 @@ attrs => delete_undef_values($attrs), attrs_list => keys($attrs), target => "${conf_dir}/features-available/checker.conf", - order => '10', + order => 10, notify => $_notify, } diff --git a/manifests/feature/command.pp b/manifests/feature/command.pp index 241852136..930db5c09 100644 --- a/manifests/feature/command.pp +++ b/manifests/feature/command.pp @@ -39,7 +39,7 @@ attrs => delete_undef_values($attrs), attrs_list => keys($attrs), target => "${conf_dir}/features-available/command.conf", - order => '10', + order => 10, notify => $_notify, } diff --git a/manifests/feature/compatlog.pp b/manifests/feature/compatlog.pp index 7a0371171..acfedceb6 100644 --- a/manifests/feature/compatlog.pp +++ b/manifests/feature/compatlog.pp @@ -45,7 +45,7 @@ attrs => delete_undef_values($attrs), attrs_list => keys($attrs), target => "${conf_dir}/features-available/compatlog.conf", - order => '10', + order => 10, notify => $_notify, } diff --git a/manifests/feature/debuglog.pp b/manifests/feature/debuglog.pp index b15d2eb16..d418a6d8f 100644 --- a/manifests/feature/debuglog.pp +++ b/manifests/feature/debuglog.pp @@ -41,7 +41,7 @@ attrs => delete_undef_values($attrs), attrs_list => keys($attrs), target => "${conf_dir}/features-available/debuglog.conf", - order => '10', + order => 10, notify => $_notify, } diff --git a/manifests/feature/elasticsearch.pp b/manifests/feature/elasticsearch.pp index 52cdaaf41..4bd9bd516 100644 --- a/manifests/feature/elasticsearch.pp +++ b/manifests/feature/elasticsearch.pp @@ -236,7 +236,7 @@ attrs_list => keys($attrs), target => "${conf_dir}/features-available/elasticsearch.conf", notify => $_notify, - order => '10', + order => 10, } # import library 'perfdata' diff --git a/manifests/feature/gelf.pp b/manifests/feature/gelf.pp index cbad59517..7885e9da1 100644 --- a/manifests/feature/gelf.pp +++ b/manifests/feature/gelf.pp @@ -53,7 +53,7 @@ attrs => delete_undef_values($attrs), attrs_list => keys($attrs), target => "${conf_dir}/features-available/gelf.conf", - order => '10', + order => 10, notify => $_notify, } diff --git a/manifests/feature/graphite.pp b/manifests/feature/graphite.pp index 1079299da..f1432a71b 100644 --- a/manifests/feature/graphite.pp +++ b/manifests/feature/graphite.pp @@ -63,7 +63,7 @@ attrs => delete_undef_values($attrs), attrs_list => keys($attrs), target => "${conf_dir}/features-available/graphite.conf", - order => '10', + order => 10, notify => $_notify, } diff --git a/manifests/feature/idomysql.pp b/manifests/feature/idomysql.pp index 63ed411f3..7d7b56dc5 100644 --- a/manifests/feature/idomysql.pp +++ b/manifests/feature/idomysql.pp @@ -325,7 +325,7 @@ attrs => delete_undef_values(merge($attrs, $attrs_ssl)), attrs_list => concat(keys($attrs), keys($attrs_ssl)), target => "${conf_dir}/features-available/ido-mysql.conf", - order => '10', + order => 10, notify => $_notify, } diff --git a/manifests/feature/idopgsql.pp b/manifests/feature/idopgsql.pp index 046785d26..e9e95fa46 100644 --- a/manifests/feature/idopgsql.pp +++ b/manifests/feature/idopgsql.pp @@ -152,7 +152,7 @@ attrs => delete_undef_values($attrs), attrs_list => keys($attrs), target => "${conf_dir}/features-available/ido-pgsql.conf", - order => '10', + order => 10, notify => $_notify, } diff --git a/manifests/feature/influxdb.pp b/manifests/feature/influxdb.pp index 3ae58f1ab..45caaa6ea 100644 --- a/manifests/feature/influxdb.pp +++ b/manifests/feature/influxdb.pp @@ -264,7 +264,7 @@ attrs_list => keys($attrs), target => "${conf_dir}/features-available/influxdb.conf", notify => $_notify, - order => '10', + order => 10, } # import library 'perfdata' diff --git a/manifests/feature/livestatus.pp b/manifests/feature/livestatus.pp index c177e7264..001409d55 100644 --- a/manifests/feature/livestatus.pp +++ b/manifests/feature/livestatus.pp @@ -65,7 +65,7 @@ attrs => delete_undef_values($attrs), attrs_list => keys($attrs), target => "${conf_dir}/features-available/livestatus.conf", - order => '10', + order => 10, notify => $_notify, } diff --git a/manifests/feature/mainlog.pp b/manifests/feature/mainlog.pp index 15c94653a..6011d35da 100644 --- a/manifests/feature/mainlog.pp +++ b/manifests/feature/mainlog.pp @@ -44,7 +44,7 @@ attrs => delete_undef_values($attrs), attrs_list => keys($attrs), target => "${conf_dir}/features-available/mainlog.conf", - order => '10', + order => 10, notify => $_notify, } diff --git a/manifests/feature/notification.pp b/manifests/feature/notification.pp index 9e7255761..3c7736f77 100644 --- a/manifests/feature/notification.pp +++ b/manifests/feature/notification.pp @@ -41,7 +41,7 @@ attrs => delete_undef_values($attrs), attrs_list => keys($attrs), target => "${conf_dir}/features-available/notification.conf", - order => '10', + order => 10, notify => $_notify, } diff --git a/manifests/feature/opentsdb.pp b/manifests/feature/opentsdb.pp index 0db2c727d..b3e2c0c21 100644 --- a/manifests/feature/opentsdb.pp +++ b/manifests/feature/opentsdb.pp @@ -43,7 +43,7 @@ attrs => delete_undef_values($attrs), attrs_list => keys($attrs), target => "${conf_dir}/features-available/opentsdb.conf", - order => '10', + order => 10, notify => $_notify, } diff --git a/manifests/feature/perfdata.pp b/manifests/feature/perfdata.pp index e5916f90a..dbf4703a5 100644 --- a/manifests/feature/perfdata.pp +++ b/manifests/feature/perfdata.pp @@ -78,7 +78,7 @@ attrs => delete_undef_values($attrs), attrs_list => keys($attrs), target => "${conf_dir}/features-available/perfdata.conf", - order => '10', + order => 10, notify => $_notify, } diff --git a/manifests/feature/statusdata.pp b/manifests/feature/statusdata.pp index 102e80614..8573c74fd 100644 --- a/manifests/feature/statusdata.pp +++ b/manifests/feature/statusdata.pp @@ -53,7 +53,7 @@ attrs => delete_undef_values($attrs), attrs_list => keys($attrs), target => "${conf_dir}/features-available/statusdata.conf", - order => '10', + order => 10, notify => $_notify, } diff --git a/manifests/feature/syslog.pp b/manifests/feature/syslog.pp index 410899954..9cecde6e9 100644 --- a/manifests/feature/syslog.pp +++ b/manifests/feature/syslog.pp @@ -39,7 +39,7 @@ attrs => delete_undef_values($attrs), attrs_list => keys($attrs), target => "${conf_dir}/features-available/syslog.conf", - order => '10', + order => 10, notify => $_notify, } diff --git a/manifests/object.pp b/manifests/object.pp index 7b74522ef..52206f60d 100644 --- a/manifests/object.pp +++ b/manifests/object.pp @@ -45,7 +45,7 @@ # first time. # # [*order*] -# String to set the position in the target file, sorted alpha numeric. +# String or integer to set the position in the target file, sorted alpha numeric. # # [*attrs_list*] # Array of all possible attributes for this object type. @@ -61,20 +61,20 @@ # # define icinga2::object( - String $object_type, - Stdlib::Absolutepath $target, - String $order, - Enum['present', 'absent'] $ensure = present, - String $object_name = $title, - Boolean $template = false, - Variant[Boolean, Pattern[/^.+\s+(=>\s+.+\s+)?in\s+.+$/]] $apply = false, - Array $attrs_list = [], - Optional[Enum['Host', 'Service']] $apply_target = undef, - Boolean $prefix = false, - Array $import = [], - Array $assign = [], - Array $ignore = [], - Hash $attrs = {}, + String $object_type, + Stdlib::Absolutepath $target, + Variant[String, Integer] $order, + Enum['present', 'absent'] $ensure = present, + String $object_name = $title, + Boolean $template = false, + Variant[Boolean, Pattern[/^.+\s+(=>\s+.+\s+)?in\s+.+$/]] $apply = false, + Array $attrs_list = [], + Optional[Enum['Host', 'Service']] $apply_target = undef, + Variant[Boolean, String] $prefix = false, + Array $import = [], + Array $assign = [], + Array $ignore = [], + Hash $attrs = {}, ) { assert_private() diff --git a/manifests/object/apiuser.pp b/manifests/object/apiuser.pp index 88accc155..586298c86 100644 --- a/manifests/object/apiuser.pp +++ b/manifests/object/apiuser.pp @@ -25,7 +25,7 @@ # first time. # # [*order*] -# String to set the position in the target file, sorted alpha numeric. Defaults to 10. +# String or integer to set the position in the target file, sorted alpha numeric. Defaults to 10. # # === Examples # @@ -46,13 +46,13 @@ # # define icinga2::object::apiuser( - Stdlib::Absolutepath $target, - Array $permissions, - Enum['absent', 'present'] $ensure = present, - String $apiuser_name = $title, - Optional[String] $password = undef, - Optional[String] $client_cn = undef, - Pattern[/^\d+$/] $order = '30', + Stdlib::Absolutepath $target, + Array $permissions, + Enum['absent', 'present'] $ensure = present, + String $apiuser_name = $title, + Optional[String] $password = undef, + Optional[String] $client_cn = undef, + Variant[String, Integer] $order = 30, ) { # compose the attributes diff --git a/manifests/object/checkcommand.pp b/manifests/object/checkcommand.pp index 646a1bb2c..ff0408a61 100644 --- a/manifests/object/checkcommand.pp +++ b/manifests/object/checkcommand.pp @@ -36,7 +36,7 @@ # first time. # # [*order*] -# String to set the position in the target file, sorted alpha numeric. Defaults to 10. +# String or integer to set the position in the target file, sorted alpha numeric. Defaults to 10. # # define icinga2::object::checkcommand( @@ -50,7 +50,7 @@ Optional[Integer[1]] $timeout = undef, Optional[Hash] $arguments = undef, Boolean $template = false, - Pattern[/^\d+$/] $order = '15', + Variant[String, Integer] $order = 15, ) { # compose the attributes diff --git a/manifests/object/checkresultreader.pp b/manifests/object/checkresultreader.pp index 6c1dfa3fa..9e5e3f3a6 100644 --- a/manifests/object/checkresultreader.pp +++ b/manifests/object/checkresultreader.pp @@ -18,15 +18,15 @@ # first time. # # [*order*] -# String to set the position in the target file, sorted alpha numeric. Defaults to 30. +# String or integer to set the position in the target file, sorted alpha numeric. Defaults to 10. # # define icinga2::object::checkresultreader ( - Stdlib::Absolutepath $target, - Enum['absent', 'present'] $ensure = present, - String $checkresultreader_name = $title, - Optional[Stdlib::Absolutepath] $spool_dir = undef, - Pattern[/^\d+$/] $order = '10', + Stdlib::Absolutepath $target, + Enum['absent', 'present'] $ensure = present, + String $checkresultreader_name = $title, + Optional[Stdlib::Absolutepath] $spool_dir = undef, + Variant[String, Integer] $order = '05', ){ # compose the attributes @@ -50,6 +50,6 @@ concat::fragment { "icinga2::object::CheckResultReader::${title}-library": target => $target, content => "library \"compat\"\n\n", - order => '05', + order => $order, } } diff --git a/manifests/object/compatlogger.pp b/manifests/object/compatlogger.pp index 762c5cf13..a07f22351 100644 --- a/manifests/object/compatlogger.pp +++ b/manifests/object/compatlogger.pp @@ -22,12 +22,12 @@ # # define icinga2::object::compatlogger ( - Stdlib::Absolutepath $target, - Enum['absent', 'present'] $ensure = present, - String $compatlogger_name = $title, - Optional[Stdlib::Absolutepath] $log_dir = undef, - Optional[Enum['DAILY', 'HOURLY', 'MONTHLY', 'WEEKLY']] $rotation_method = undef, - Pattern[/^\d+$/] $order = '5', + Stdlib::Absolutepath $target, + Enum['absent', 'present'] $ensure = present, + String $compatlogger_name = $title, + Optional[Stdlib::Absolutepath] $log_dir = undef, + Optional[Enum['DAILY', 'HOURLY', 'MONTHLY', 'WEEKLY']] $rotation_method = undef, + Variant[String, Integer] $order = '05', ){ # compose the attributes @@ -52,6 +52,6 @@ concat::fragment { "icinga2::object::CompatLogger::${title}-library": target => $target, content => "library \"compat\"\n\n", - order => '05', + order => $order, } } diff --git a/manifests/object/dependency.pp b/manifests/object/dependency.pp index da7b65b39..2dc70fdbc 100644 --- a/manifests/object/dependency.pp +++ b/manifests/object/dependency.pp @@ -70,30 +70,30 @@ # first time. # # [*order*] -# String to set the position in the target file, sorted alpha numeric. Defaults to 35. +# String or integer to set the position in the target file, sorted alpha numeric. Defaults to 70. # # define icinga2::object::dependency ( - Stdlib::Absolutepath $target, - Enum['absent', 'present'] $ensure = present, - String $dependency_name = $title, - Optional[String] $parent_host_name = undef, - Optional[String] $parent_service_name = undef, - Optional[String] $child_host_name = undef, - Optional[String] $child_service_name = undef, - Optional[Boolean] $disable_checks = undef, - Optional[Boolean] $disable_notifications = undef, - Optional[Boolean] $ignore_soft_states = undef, - Optional[String] $period = undef, - Optional[Array] $states = undef, - Variant[Boolean, String] $apply = false, - Boolean $prefix = false, - Enum['Host', 'Service'] $apply_target = 'Host', - Array $assign = [], - Array $ignore = [], - Array $import = [], - Boolean $template = false, - Pattern[/^\d+$/] $order = '70', + Stdlib::Absolutepath $target, + Enum['absent', 'present'] $ensure = present, + String $dependency_name = $title, + Optional[String] $parent_host_name = undef, + Optional[String] $parent_service_name = undef, + Optional[String] $child_host_name = undef, + Optional[String] $child_service_name = undef, + Optional[Boolean] $disable_checks = undef, + Optional[Boolean] $disable_notifications = undef, + Optional[Boolean] $ignore_soft_states = undef, + Optional[String] $period = undef, + Optional[Array] $states = undef, + Variant[Boolean, String] $apply = false, + Variant[String, Boolean] $prefix = false, + Enum['Host', 'Service'] $apply_target = 'Host', + Array $assign = [], + Array $ignore = [], + Array $import = [], + Boolean $template = false, + Variant[String, Integer] $order = 70, ){ # compose attributes diff --git a/manifests/object/endpoint.pp b/manifests/object/endpoint.pp index 75d6368c3..43a993733 100644 --- a/manifests/object/endpoint.pp +++ b/manifests/object/endpoint.pp @@ -27,17 +27,17 @@ # first time. # # [*order*] -# String to set the position in the target file, sorted alpha numeric. Defaults to 10. +# String or integer to set the position in the target file, sorted alpha numeric. Defaults to 40. # # define icinga2::object::endpoint( - Enum['absent', 'present'] $ensure = present, - Optional[String] $endpoint_name = $title, - Optional[String] $host = undef, - Optional[Integer[1,65535]] $port = undef, - Optional[Pattern[/^\d+\.?\d*[d|h|m|s]?$/]] $log_duration = undef, - Optional[Stdlib::Absolutepath] $target = undef, - Pattern[/^\d+$/] $order = '40', + Enum['absent', 'present'] $ensure = present, + Optional[String] $endpoint_name = $title, + Optional[String] $host = undef, + Optional[Integer[1,65535]] $port = undef, + Optional[Pattern[/^\d+\.?\d*[d|h|m|s]?$/]] $log_duration = undef, + Optional[Stdlib::Absolutepath] $target = undef, + Variant[String, Integer] $order = 40, ) { include ::icinga2::params diff --git a/manifests/object/eventcommand.pp b/manifests/object/eventcommand.pp index b32deeef2..4a38f46d6 100644 --- a/manifests/object/eventcommand.pp +++ b/manifests/object/eventcommand.pp @@ -40,7 +40,7 @@ # Sorted List of templates to include. Defaults to an empty list. # # [*order*] -# String to set the position in the target file, sorted alpha numeric. Defaults to 30. +# String or integer to set the position in the target file, sorted alpha numeric. Defaults to 20. # # define icinga2::object::eventcommand ( @@ -53,7 +53,7 @@ Optional[Integer[1]] $timeout = undef, Optional[Hash] $arguments = undef, Array $import = ['plugin-event-command'], - Pattern[/^\d+$/] $order = '20', + Variant[String, Integer] $order = 20, ){ # compose the attributes diff --git a/manifests/object/host.pp b/manifests/object/host.pp index 671ed8c37..f4651ea06 100644 --- a/manifests/object/host.pp +++ b/manifests/object/host.pp @@ -104,7 +104,7 @@ # first time. # # [*order*] -# String to set the position in the target file, sorted alpha numeric. Defaults to 10. +# String or integer to set the position in the target file, sorted alpha numeric. Defaults to 50. # # define icinga2::object::host( @@ -140,7 +140,7 @@ Optional[Stdlib::Absolutepath] $icon_image = undef, Optional[String] $icon_image_alt = undef, Boolean $template = false, - Pattern[/^\d+$/] $order = '50', + Variant[String, Integer] $order = 50, ) { # compose the attributes diff --git a/manifests/object/hostgroup.pp b/manifests/object/hostgroup.pp index 73863fe4b..d3f5cf43b 100644 --- a/manifests/object/hostgroup.pp +++ b/manifests/object/hostgroup.pp @@ -21,7 +21,7 @@ # first time. # # [*order*] -# String to set the position in the target file, sorted alpha numeric. Defaults to 10. +# String or integer to set the position in the target file, sorted alpha numeric. Defaults to 55. # # === Examples # @@ -34,14 +34,14 @@ # # define icinga2::object::hostgroup( - Stdlib::Absolutepath $target, - Enum['absent', 'present'] $ensure = present, - String $hostgroup_name = $title, - Optional[String] $display_name = undef, - Optional[Array] $groups = undef, - Array $assign = [], - Array $ignore = [], - Pattern[/^\d+$/] $order = '55', + Stdlib::Absolutepath $target, + Enum['absent', 'present'] $ensure = present, + String $hostgroup_name = $title, + Optional[String] $display_name = undef, + Optional[Array] $groups = undef, + Array $assign = [], + Array $ignore = [], + Variant[String, Integer] $order = 55, ) { if $ignore != [] and $assign == [] { diff --git a/manifests/object/notification.pp b/manifests/object/notification.pp index 982eb02a2..8d0e5a7f4 100644 --- a/manifests/object/notification.pp +++ b/manifests/object/notification.pp @@ -75,33 +75,33 @@ # first time. # # [*order*] -# String to set the position in the target file, sorted alpha numeric. Defaults to 10. +# String or integer to set the position in the target file, sorted alpha numeric. Defaults to 85. # # define icinga2::object::notification ( - Stdlib::Absolutepath $target, - Enum['absent', 'present'] $ensure = present, - String $notification_name = $title, - Optional[String] $host_name = undef, - Optional[String] $service_name = undef, - Optional[Variant[String, Hash]] $vars = undef, - Optional[Variant[String, Array]] $users = undef, - Optional[Variant[String, Array]] $user_groups = undef, - Optional[Hash] $times = undef, - Optional[String] $command = undef, - Optional[Pattern[/^\d+\.?\d*[d|h|m|s]?$/]] $interval = undef, - Optional[String] $period = undef, - Optional[String] $zone = undef, - Optional[Variant[Array, String]] $types = undef, - Optional[Variant[Array, String]] $states = undef, - Variant[Boolean, String] $apply = false, - Variant[Boolean, String] $prefix = false, - Enum['Host', 'Service'] $apply_target = 'Host', - Array $assign = [], - Array $ignore = [], - Array $import = [], - Boolean $template = false, - Pattern[/^\d+$/] $order = '85', + Stdlib::Absolutepath $target, + Enum['absent', 'present'] $ensure = present, + String $notification_name = $title, + Optional[String] $host_name = undef, + Optional[String] $service_name = undef, + Optional[Variant[String, Hash]] $vars = undef, + Optional[Variant[String, Array]] $users = undef, + Optional[Variant[String, Array]] $user_groups = undef, + Optional[Hash] $times = undef, + Optional[String] $command = undef, + Optional[Pattern[/^\d+\.?\d*[d|h|m|s]?$/]] $interval = undef, + Optional[String] $period = undef, + Optional[String] $zone = undef, + Optional[Variant[Array, String]] $types = undef, + Optional[Variant[Array, String]] $states = undef, + Variant[Boolean, String] $apply = false, + Variant[Boolean, String] $prefix = false, + Enum['Host', 'Service'] $apply_target = 'Host', + Array $assign = [], + Array $ignore = [], + Array $import = [], + Boolean $template = false, + Variant[String, Integer] $order = 85, ){ if $ignore != [] and $assign == [] { diff --git a/manifests/object/notificationcommand.pp b/manifests/object/notificationcommand.pp index 9a378b940..568dcb628 100644 --- a/manifests/object/notificationcommand.pp +++ b/manifests/object/notificationcommand.pp @@ -45,7 +45,7 @@ # first time. # # [*order*] -# String to set the position in the target file, sorted alpha numeric. Defaults to 10. +# String or integer to set the position in the target file, sorted alpha numeric. Defaults to 25. # # define icinga2::object::notificationcommand ( @@ -59,7 +59,7 @@ Optional[Hash] $arguments = undef, Boolean $template = false, Array $import = ['plugin-notification-command'], - Pattern[/^\d+$/] $order = '25', + Variant[String, Integer] $order = 25, ){ # compose attributes diff --git a/manifests/object/scheduleddowntime.pp b/manifests/object/scheduleddowntime.pp index b2827d10d..3150206af 100644 --- a/manifests/object/scheduleddowntime.pp +++ b/manifests/object/scheduleddowntime.pp @@ -52,26 +52,26 @@ # first time. # # [*order*] -# String to set the position in the target file, sorted alpha numeric. Defaults to 30. +# String or integer to set the position in the target file, sorted alpha numeric. Defaults to 90. # # define icinga2::object::scheduleddowntime ( - Stdlib::Absolutepath $target, - Enum['absent', 'present'] $ensure = present, - String $scheduleddowntime_name = $title, - Optional[String] $host_name = undef, - Optional[String] $service_name = undef, - Optional[String] $author = undef, - Optional[String] $comment = undef, - Optional[Boolean] $fixed = undef, - Optional[Pattern[/^\d+(\.\d+)?[dhms]?$/]] $duration = undef, - Optional[Hash] $ranges = undef, - Variant[Boolean, String] $apply = false, - Boolean $prefix = false, - Enum['Host', 'Service'] $apply_target = 'Host', - Array $assign = [], - Array $ignore = [], - Pattern[/^\d+$/] $order = '90', + Stdlib::Absolutepath $target, + Enum['absent', 'present'] $ensure = present, + String $scheduleddowntime_name = $title, + Optional[String] $host_name = undef, + Optional[String] $service_name = undef, + Optional[String] $author = undef, + Optional[String] $comment = undef, + Optional[Boolean] $fixed = undef, + Optional[Pattern[/^\d+(\.\d+)?[dhms]?$/]] $duration = undef, + Optional[Hash] $ranges = undef, + Variant[Boolean, String] $apply = false, + Variant[String, Boolean] $prefix = false, + Enum['Host', 'Service'] $apply_target = 'Host', + Array $assign = [], + Array $ignore = [], + Variant[String, Integer] $order = 90, ){ # compose attributes diff --git a/manifests/object/service.pp b/manifests/object/service.pp index d9e0733e7..6b62be0e3 100644 --- a/manifests/object/service.pp +++ b/manifests/object/service.pp @@ -126,7 +126,7 @@ # first time. # # [*order*] -# String to set the position in the target file, sorted alpha numeric. Defaults to 10. +# String or integer to set the position in the target file, sorted alpha numeric. Defaults to 60. # # === Examples # @@ -193,7 +193,7 @@ Array $ignore = [], Array $import = [], Boolean $template = false, - Pattern[/^\d+$/] $order = '60', + Variant[String, Integer] $order = 60, ) { # compose the attributes diff --git a/manifests/object/servicegroup.pp b/manifests/object/servicegroup.pp index 35dbef99c..43a8400b0 100644 --- a/manifests/object/servicegroup.pp +++ b/manifests/object/servicegroup.pp @@ -33,20 +33,20 @@ # first time. # # [*order*] -# String to set the position in the target file, sorted alpha numeric. Defaults to 30. +# String or integer to set the position in the target file, sorted alpha numeric. Defaults to 65. # # define icinga2::object::servicegroup ( Stdlib::Absolutepath $target, - Enum['absent', 'present'] $ensure = present, - String $servicegroup_name = $title, - Optional[String] $display_name = undef, - Optional[Array] $groups = undef, - Array $assign = [], - Array $ignore = [], - Boolean $template = false, - Array $import = [], - Pattern[/^\d+$/] $order = '65', + Enum['absent', 'present'] $ensure = present, + String $servicegroup_name = $title, + Optional[String] $display_name = undef, + Optional[Array] $groups = undef, + Array $assign = [], + Array $ignore = [], + Boolean $template = false, + Array $import = [], + Variant[String, Integer] $order = 65, ){ # compose attributes diff --git a/manifests/object/timeperiod.pp b/manifests/object/timeperiod.pp index 6fa698413..02ba3e206 100644 --- a/manifests/object/timeperiod.pp +++ b/manifests/object/timeperiod.pp @@ -36,21 +36,21 @@ # Destination config file to store this object in. File will be declared on the first run. # # [*order*] -# String to control the position in the target file, sorted alpha numeric. +# 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'], - Pattern[/^\d+$/] $order = '35', + 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 diff --git a/manifests/object/user.pp b/manifests/object/user.pp index fb6444fc8..9c5800058 100644 --- a/manifests/object/user.pp +++ b/manifests/object/user.pp @@ -52,7 +52,7 @@ # first time. # # [*order*] -# String to set the position in the target file, sorted alpha numeric. Defaults to 30. +# String or integer to set the position in the target file, sorted alpha numeric. Defaults to 75. # # define icinga2::object::user ( @@ -70,7 +70,7 @@ Optional[Array] $states = undef, Array $import = [], Boolean $template = false, - Pattern[/^\d+$/] $order = '75', + Variant[String, Integer] $order = 75, ){ # compose attributes diff --git a/manifests/object/usergroup.pp b/manifests/object/usergroup.pp index 821f9dac5..0aafdded4 100644 --- a/manifests/object/usergroup.pp +++ b/manifests/object/usergroup.pp @@ -33,20 +33,20 @@ # first time. # # [*order*] -# String to set the position in the target file, sorted alpha numeric. Defaults to 10. +# String or integer to set the position in the target file, sorted alpha numeric. Defaults to 80. # # define icinga2::object::usergroup ( - Stdlib::Absolutepath $target, - Enum['absent', 'present'] $ensure = present, - String $usergroup_name = $title, - Optional[String] $display_name = undef, - Array $groups = [], - Array $assign = [], - Array $ignore = [], - Array $import = [], - Boolean $template = false, - Pattern[/^\d+$/] $order = '80', + Stdlib::Absolutepath $target, + Enum['absent', 'present'] $ensure = present, + String $usergroup_name = $title, + Optional[String] $display_name = undef, + Array $groups = [], + Array $assign = [], + Array $ignore = [], + Array $import = [], + Boolean $template = false, + Variant[String, Integer] $order = 80, ){ if $ignore != [] and $assign == [] { diff --git a/manifests/object/zone.pp b/manifests/object/zone.pp index de22f45e7..4b4ec2022 100644 --- a/manifests/object/zone.pp +++ b/manifests/object/zone.pp @@ -25,17 +25,17 @@ # first time. # # [*order*] -# String to control the position in the target file, sorted alpha numeric. +# String or integer to control the position in the target file, sorted alpha numeric. Defaults to 45. # # define icinga2::object::zone( - Enum['absent', 'present'] $ensure = present, - String $zone_name = $title, - Optional[Array] $endpoints = [], - Optional[String] $parent = undef, - Optional[Boolean] $global = false, - Optional[Stdlib::Absolutepath] $target = undef, - Pattern[/^\d+$/] $order = '45', + Enum['absent', 'present'] $ensure = present, + String $zone_name = $title, + Optional[Array] $endpoints = [], + Optional[String] $parent = undef, + Optional[Boolean] $global = false, + Optional[Stdlib::Absolutepath] $target = undef, + Variant[String, Integer] $order = 45, ) { include ::icinga2::params