From 1214c178115e97671610658f1cd9661e3331884d Mon Sep 17 00:00:00 2001 From: "ricardo@cropalato.com.br" Date: Wed, 26 Nov 2014 07:51:44 -0500 Subject: [PATCH 01/79] Adding FileLogger object. #7229. --- README.md | 16 ++++++++++ manifests/object/filelogger.pp | 45 ++++++++++++++++++++++++++++ templates/object_filelogger.conf.erb | 18 +++++++++++ 3 files changed, 79 insertions(+) create mode 100644 manifests/object/filelogger.pp create mode 100644 templates/object_filelogger.conf.erb diff --git a/README.md b/README.md index 7de8f4e..7b1ceb6 100644 --- a/README.md +++ b/README.md @@ -385,6 +385,7 @@ Object types: * [icinga2::object::checkresultreader](#icinga2objectcheckresultreader) * [icinga2::object::eventcommand](#icinga2objecteventcommand) * [icinga2::object::externalcommandlistener](#icinga2objectexternalcommandlistener) +* [icinga2::object::filelogger](#icinga2objectfilelogger) * [icinga2::object::host](#icinga2objecthost) * [icinga2::object::hostgroup](#icinga2objecthostgroup) * [icinga2::object::idomysqlconnection](#icinga2objectidomysqlconnection) @@ -578,6 +579,21 @@ icinga2::object::externalcommandlistener { 'external': See [ExternalCommandListener](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-externalcommandlistener) on [docs.icinga.org](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc) for a full list of parameters. +####[`icinga2::object::filelogger`](id:object_filelogger) + +This defined type creates file logger objects. + +Example: + +
+icinga2::object::filelogger { 'debug-file':
+  severity => 'debug',
+  path     => '/var/log/icinga2/debug.log',
+}
+
+ +See [FileLogger](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-filelogger) on [docs.icinga.org](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc) for a full list of parameters. + ####[`icinga2::object::host`](id:object_host) This defined type creates host objects. diff --git a/manifests/object/filelogger.pp b/manifests/object/filelogger.pp new file mode 100644 index 0000000..43e0154 --- /dev/null +++ b/manifests/object/filelogger.pp @@ -0,0 +1,45 @@ +# == Defined type: icinga2::object::filelogger +# +# This is a defined type for Icinga 2 apply objects that create File Logger +# See the following Icinga 2 doc page for more info: +# http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-filelogger +# +# === Parameters +# +# See the inline comments. +# + +define icinga2::object::filelogger ( + $ensure = 'file', + $object_name = $name, + $path = undef, + $severity = undef, + $target_dir = '/etc/icinga2/conf.d', + $target_file_name = "${object_name}.conf", + $target_file_owner = 'root', + $target_file_group = 'root', + $target_file_mode = '0644' +) { + + if $object_name { + validate_string($object_name) + } + validate_string($path) + if $severity { + validate_string($severity) + } + validate_string($target_dir) + validate_string($target_file_name) + validate_string($target_file_owner) + validate_string($target_file_group) + validate_re($target_file_mode, '^\d{4}$') + + file {"${target_dir}/${target_file_name}": + ensure => $ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_filelogger.conf.erb'), + notify => Service['icinga2'] + } +} diff --git a/templates/object_filelogger.conf.erb b/templates/object_filelogger.conf.erb new file mode 100644 index 0000000..aab83ef --- /dev/null +++ b/templates/object_filelogger.conf.erb @@ -0,0 +1,18 @@ +/** +* WARNING: This FileLogger is automatically generated by Puppet. +* ANY MANUAL CHANGES TO IT WILL GET OVERWRITTEN! +*/ + +/** +* A FileLogger definition. You can create your own configuration files +* in the conf.d directory (e.g. one per commnand). By default all *.conf +* files in this directory are included. +* +*/ + +object FileLogger "<%= @object_name %>" { + <%- if @severity -%> + severity = "<%= severity -%>" + <%- end -%> + path = "<%= @path -%>" +} From caafad45ea8d3293aa18a878f09eb1f938bce55d Mon Sep 17 00:00:00 2001 From: "ricardo@cropalato.com.br" Date: Wed, 26 Nov 2014 08:19:27 -0500 Subject: [PATCH 02/79] Adding IcingaStatusWriter object. #7230 --- README.md | 15 +++++++ manifests/object/icingastatuswriter.pp | 44 ++++++++++++++++++++ templates/object_icingastatuswriter.conf.erb | 20 +++++++++ 3 files changed, 79 insertions(+) create mode 100644 manifests/object/icingastatuswriter.pp create mode 100644 templates/object_icingastatuswriter.conf.erb diff --git a/README.md b/README.md index 7de8f4e..27334d0 100644 --- a/README.md +++ b/README.md @@ -387,6 +387,7 @@ Object types: * [icinga2::object::externalcommandlistener](#icinga2objectexternalcommandlistener) * [icinga2::object::host](#icinga2objecthost) * [icinga2::object::hostgroup](#icinga2objecthostgroup) +* [icinga2::object::icingastatuswriter](#icinga2objecticingastatuswriter) * [icinga2::object::idomysqlconnection](#icinga2objectidomysqlconnection) * [icinga2::object::idopgsqlconnection](#icinga2objectidopgsqlconnection) * [icinga2::object::livestatuslistener](#icinga2objectlivestatuslistener) @@ -620,6 +621,20 @@ If you would like to use an IPv6 address, make sure to set the `ipv6_address` pa Coming soon... +####[`icinga2::object::icingastatuswriter`](id:object_icingastatuswriter) + +This defined type creates an **IcingaStatusWriter** objects. + +Example usage: +
+icinga2::object::icingastatuswriter { 'status':
+   status_path       => '/cache/icinga2/status.json',
+   update_interval   => '15s',
+}
+
+ +See [IcingaStatusWriter](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-icingastatuswriter) on [docs.icinga.org](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc) for more details about the object. + ####[`icinga2::object::idomysqlconnection`](id:object_idomysqlconnection) This defined type creates an **IdoMySqlConnection** objects. diff --git a/manifests/object/icingastatuswriter.pp b/manifests/object/icingastatuswriter.pp new file mode 100644 index 0000000..61fdb69 --- /dev/null +++ b/manifests/object/icingastatuswriter.pp @@ -0,0 +1,44 @@ +# == Defined type: icinga2::object::icingastatuswriter +# +# This is a defined type for Icinga 2 apply objects that create IcingaStatusWriter +# See the following Icinga 2 doc page for more info: +# http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-checkercomponent +# +# === Parameters +# +# See the inline comments. +# + +define icinga2::object::icingastatuswriter ( + $ensure = 'file', + $object_name = $name, + $status_path = undef, + $update_internal = undef, + $target_dir = '/etc/icinga2/objects/icingastatuswriters', + $target_file_name = "${name}.conf", + $target_file_owner = 'root', + $target_file_group = 'root', + $target_file_mode = '0644' +) { + + if $status_path { + validate_string($status_path) + } + if $update_internal { + validate_string($update_internal) + } + validate_string($target_dir) + validate_string($target_file_name) + validate_string($target_file_owner) + validate_string($target_file_group) + validate_re($target_file_mode, '^\d{4}$') + + file {"${target_dir}/${target_file_name}": + ensure => $ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_icingastatuswriter.conf.erb'), + notify => Service['icinga2'], + } +} diff --git a/templates/object_icingastatuswriter.conf.erb b/templates/object_icingastatuswriter.conf.erb new file mode 100644 index 0000000..6dad90f --- /dev/null +++ b/templates/object_icingastatuswriter.conf.erb @@ -0,0 +1,20 @@ +/** +* WARNING: This IcingaStatusWriter is automatically generated by Puppet. +* ANY MANUAL CHANGES TO IT WILL GET OVERWRITTEN! +*/ + +/** +* A IcingaStatusWriter definition. You can create your own configuration files +* in the conf.d directory (e.g. one per commnand). By default all *.conf +* files in this directory are included. +* +*/ + +object IcingaStatusWriter "<%= @object_name %>" { +<%- if @status_path -%> + status_path = LocalStateDir + "<%= @status_path -%>" +<%- end -%> +<%- if @update_interval -%> + update_interval = <%= @update_interval -%> +<%- end -%> +} From b71ee7644c11d33f0074d546547f8ee1eb91fd4d Mon Sep 17 00:00:00 2001 From: Ricardo Melo Date: Tue, 2 Dec 2014 15:15:31 -0500 Subject: [PATCH 03/79] * fixed default parameter value --- manifests/object/filelogger.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/object/filelogger.pp b/manifests/object/filelogger.pp index 43e0154..1f7c98c 100644 --- a/manifests/object/filelogger.pp +++ b/manifests/object/filelogger.pp @@ -15,7 +15,7 @@ define icinga2::object::filelogger ( $path = undef, $severity = undef, $target_dir = '/etc/icinga2/conf.d', - $target_file_name = "${object_name}.conf", + $target_file_name = "${name}.conf", $target_file_owner = 'root', $target_file_group = 'root', $target_file_mode = '0644' From bef09edad1dcaa085746c5bdf9d1752fce676710 Mon Sep 17 00:00:00 2001 From: Ricardo Melo Date: Tue, 2 Dec 2014 15:28:33 -0500 Subject: [PATCH 04/79] * fixed typo --- manifests/object/icingastatuswriter.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/object/icingastatuswriter.pp b/manifests/object/icingastatuswriter.pp index 61fdb69..9dcd87f 100644 --- a/manifests/object/icingastatuswriter.pp +++ b/manifests/object/icingastatuswriter.pp @@ -13,7 +13,7 @@ define icinga2::object::icingastatuswriter ( $ensure = 'file', $object_name = $name, $status_path = undef, - $update_internal = undef, + $update_interval = undef, $target_dir = '/etc/icinga2/objects/icingastatuswriters', $target_file_name = "${name}.conf", $target_file_owner = 'root', @@ -24,8 +24,8 @@ define icinga2::object::icingastatuswriter ( if $status_path { validate_string($status_path) } - if $update_internal { - validate_string($update_internal) + if $update_interval { + validate_string($update_interval) } validate_string($target_dir) validate_string($target_file_name) From bb523a9dc616854d64f567d43e619747e90fc2be Mon Sep 17 00:00:00 2001 From: Alexandre Beche Date: Fri, 12 Dec 2014 15:42:58 +0100 Subject: [PATCH 05/79] Adding support for RedHat --- manifests/params.pp | 14 +++++++------- manifests/server/install.pp | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 0871254..cd674ba 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -19,7 +19,7 @@ class icinga2::params { # Icinga 2 common package parameters case $::operatingsystem { #CentOS systems: - 'CentOS': { + 'CentOS', 'RedHat': { #Pick the right package provider: $package_provider = 'yum' } @@ -70,7 +70,7 @@ class icinga2::params { #Pick the right package parameters based on the OS: case $::operatingsystem { #CentOS systems: - 'CentOS': { + 'CentOS', 'RedHat': { case $::operatingsystemmajrelease { '5': { #Icinga 2 server package @@ -144,7 +144,7 @@ class icinga2::params { case $::operatingsystem { #CentOS systems: - 'CentOS': { + 'CentOS', 'RedHat': { #Settings for /etc/icinga2/: $etc_icinga2_owner = 'icinga' $etc_icinga2_group = 'icinga' @@ -244,7 +244,7 @@ class icinga2::params { case $::operatingsystem { #Icinga 2 server daemon names for Red Had/CentOS systems: - 'CentOS': { + 'CentOS', 'RedHat': { case $::operatingsystemmajrelease { '5': { $icinga2_server_service_name = 'icinga2' @@ -314,7 +314,7 @@ class icinga2::params { case $::operatingsystem { #File and template variable names for Red Had/CentOS systems: - 'CentOS': { + 'CentOS', 'RedHat': { $nrpe_config_basedir = '/etc/nagios' $nrpe_plugin_libdir = '/usr/lib64/nagios/plugins' $checkplugin_libdir = '/usr/lib64/nagios/plugins' @@ -348,7 +348,7 @@ class icinga2::params { # Icinga 2 client package parameters case $::operatingsystem { #CentOS systems: - 'CentOS': { + 'CentOS', 'RedHat': { case $::operatingsystemmajrelease { '5': { #Pick the right list of client packages: @@ -409,7 +409,7 @@ class icinga2::params { # Icinga 2 client service parameters case $::operatingsystem { #Daemon names for Red Had/CentOS systems: - 'CentOS': { + 'CentOS', 'RedHat': { $nrpe_daemon_name = 'nrpe' } diff --git a/manifests/server/install.pp b/manifests/server/install.pp index 9db78be..5bba9bf 100644 --- a/manifests/server/install.pp +++ b/manifests/server/install.pp @@ -33,7 +33,7 @@ class icinga2::server::install::repos inherits icinga2::server { if $manage_repos == true { case $::operatingsystem { #CentOS systems: - 'CentOS': { + 'CentOS', 'RedHat': { #Add the official Icinga Yum repository: http://packages.icinga.org/epel/ yumrepo { 'icinga2_yum_repo': From 6c5497d3c8d8f829fa17ff65bc83b854983acddc Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Mon, 1 Dec 2014 21:38:42 -0800 Subject: [PATCH 06/79] Added refresh_icinga2_service parameters to each of the object defined types so that they can be used by themselves if the module isn't being used to also manage the Icinga 2 service. refs# 7856 : https://dev.icinga.org/issues/7856 --- manifests/object/apply_dependency.pp | 39 +++++++--- .../object/apply_notification_to_host.pp | 37 +++++++-- .../object/apply_notification_to_service.pp | 37 +++++++-- manifests/object/apply_service_to_host.pp | 35 +++++++-- manifests/object/checkcommand.pp | 75 ++++++++++++++----- manifests/object/checkresultreader.pp | 35 +++++++-- manifests/object/compatlogger.pp | 35 +++++++-- manifests/object/dependency.pp | 37 +++++++-- manifests/object/eventcommand.pp | 35 +++++++-- manifests/object/externalcommandlistener.pp | 35 +++++++-- manifests/object/graphitewriter.pp | 37 +++++++-- manifests/object/host.pp | 36 +++++++-- manifests/object/hostgroup.pp | 36 +++++++-- manifests/object/idomysqlconnection.pp | 36 +++++++-- manifests/object/idopgsqlconnection.pp | 36 +++++++-- manifests/object/livestatuslistener.pp | 37 ++++++--- manifests/object/notification.pp | 35 +++++++-- manifests/object/notificationcommand.pp | 35 +++++++-- manifests/object/perfdatawriter.pp | 35 +++++++-- manifests/object/scheduleddowntime.pp | 36 +++++++-- manifests/object/service.pp | 36 +++++++-- manifests/object/servicegroup.pp | 36 +++++++-- manifests/object/statusdatawriter.pp | 35 +++++++-- manifests/object/sysloglogger.pp | 36 +++++++-- manifests/object/timeperiod.pp | 39 +++++++--- manifests/object/user.pp | 36 +++++++-- manifests/object/usergroup.pp | 36 +++++++-- 27 files changed, 782 insertions(+), 231 deletions(-) diff --git a/manifests/object/apply_dependency.pp b/manifests/object/apply_dependency.pp index c606ca4..f965597 100644 --- a/manifests/object/apply_dependency.pp +++ b/manifests/object/apply_dependency.pp @@ -28,7 +28,9 @@ define icinga2::object::apply_dependency ( $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', - $target_file_mode = '0644') { + $target_file_mode = '0644', + $refresh_icinga2_service = true + ) { # Do some validation of the class' parameters: validate_string($object_name) validate_string($display_name) @@ -46,16 +48,35 @@ define icinga2::object::apply_dependency ( validate_string($target_file_owner) validate_string($target_file_group) validate_string($target_file_mode) + validate_bool($refresh_icinga2_service) validate_re($object_type, ['^Host', '^Service']) - file { "${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_apply_dependency.conf.erb'), - notify => Service['icinga2'], + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_apply_dependency.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_apply_dependency.conf.erb'), + } + } -} +} \ No newline at end of file diff --git a/manifests/object/apply_notification_to_host.pp b/manifests/object/apply_notification_to_host.pp index 5ace072..56dc001 100644 --- a/manifests/object/apply_notification_to_host.pp +++ b/manifests/object/apply_notification_to_host.pp @@ -29,7 +29,8 @@ define icinga2::object::apply_notification_to_host ( $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', - $target_file_mode = '0644' + $target_file_mode = '0644', + $refresh_icinga2_service = true ) { #Do some validation of the class' parameters: @@ -53,13 +54,33 @@ define icinga2::object::apply_notification_to_host ( validate_string($target_file_owner) validate_string($target_file_group) validate_re($target_file_mode, '^\d{4}$') + validate_bool($refresh_icinga2_service) + + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_apply_notification_to_host.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } - file { "${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_apply_notification_to_host.conf.erb'), - notify => Service['icinga2'], } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_apply_notification_to_host.conf.erb'), + } + + } + } diff --git a/manifests/object/apply_notification_to_service.pp b/manifests/object/apply_notification_to_service.pp index 2ddb64e..bda9a16 100644 --- a/manifests/object/apply_notification_to_service.pp +++ b/manifests/object/apply_notification_to_service.pp @@ -30,7 +30,8 @@ define icinga2::object::apply_notification_to_service ( $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', - $target_file_mode = '0644' + $target_file_mode = '0644', + $refresh_icinga2_service = true ) { #Do some validation of the class' parameters: @@ -55,13 +56,33 @@ define icinga2::object::apply_notification_to_service ( validate_string($target_file_owner) validate_string($target_file_group) validate_re($target_file_mode, '^\d{4}$') + validate_bool($refresh_icinga2_service) + + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_apply_notification_to_service.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } - file { "${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_apply_notification_to_service.conf.erb'), - notify => Service['icinga2'], } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_apply_notification_to_service.conf.erb'), + } + + } + } diff --git a/manifests/object/apply_service_to_host.pp b/manifests/object/apply_service_to_host.pp index 81d811a..6b86c6f 100644 --- a/manifests/object/apply_service_to_host.pp +++ b/manifests/object/apply_service_to_host.pp @@ -43,7 +43,8 @@ define icinga2::object::apply_service_to_host ( $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', - $target_file_mode = '0644' + $target_file_mode = '0644', + $refresh_icinga2_service = true ) { #Do some validation of the class' parameters: @@ -56,15 +57,33 @@ define icinga2::object::apply_service_to_host ( validate_string($target_file_owner) validate_string($target_file_group) validate_string($target_file_mode) + validate_bool($refresh_icinga2_service) + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_apply_service_to_host.conf.erb'), - notify => Service['icinga2'], + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_apply_service_to_host.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_apply_service_to_host.conf.erb'), + } + } } diff --git a/manifests/object/checkcommand.pp b/manifests/object/checkcommand.pp index 6ca9624..bf5ea50 100644 --- a/manifests/object/checkcommand.pp +++ b/manifests/object/checkcommand.pp @@ -29,6 +29,7 @@ define icinga2::object::checkcommand ( $target_file_owner = 'root', $target_file_group = 'root', $target_file_mode = '0644', + $refresh_icinga2_service = true ) { #Do some validation of the class' parameters: @@ -50,31 +51,65 @@ define icinga2::object::checkcommand ( validate_string($target_file_owner) validate_string($target_file_group) validate_re($target_file_mode, '^\d{4}$') + validate_bool($refresh_icinga2_service) - if $checkcommand_file_distribution_method == 'content' { - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template("${checkcommand_template_module}/${checkcommand_template}"), - notify => Service['icinga2'], - } - } - elsif $checkcommand_file_distribution_method == 'source' { - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - source => $checkcommand_source_file, - notify => Service['icinga2'], + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { + if $checkcommand_file_distribution_method == 'content' { + file {"${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template("${checkcommand_template_module}/${checkcommand_template}"), + notify => Service['icinga2'], + } + } + elsif $checkcommand_file_distribution_method == 'source' { + file {"${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + source => $checkcommand_source_file, + notify => Service['icinga2'], + } + } + else { + notify {'Missing/Incorrect File Distribution Method': + message => 'The parameter checkcommand_file_distribution_method is missing or incorrect. Please set content or source', + } } } + + #...otherwise, use the same file resource but without a notify => parameter: else { - notify {'Missing/Incorrect File Distribution Method': - message => 'The parameter checkcommand_file_distribution_method is missing or incorrect. Please set content or source', + + if $checkcommand_file_distribution_method == 'content' { + file {"${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template("${checkcommand_template_module}/${checkcommand_template}"), + } } + elsif $checkcommand_file_distribution_method == 'source' { + file {"${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + source => $checkcommand_source_file, + } + } + else { + notify {'Missing/Incorrect File Distribution Method': + message => 'The parameter checkcommand_file_distribution_method is missing or incorrect. Please set content or source', + } + } + } + } diff --git a/manifests/object/checkresultreader.pp b/manifests/object/checkresultreader.pp index b10a179..afe4d89 100644 --- a/manifests/object/checkresultreader.pp +++ b/manifests/object/checkresultreader.pp @@ -18,7 +18,8 @@ define icinga2::object::checkresultreader ( $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', - $target_file_mode = '0644' + $target_file_mode = '0644', + $refresh_icinga2_service = true ) { #Do some validation of the class' parameters: @@ -33,15 +34,33 @@ define icinga2::object::checkresultreader ( validate_string($target_file_owner) validate_string($target_file_group) validate_re($target_file_mode, '^\d{4}$') + validate_bool($refresh_icinga2_service) + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_checkresultreader.conf.erb'), - notify => Service['icinga2'], + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_checkresultreader.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_checkresultreader.conf.erb'), + } + } } diff --git a/manifests/object/compatlogger.pp b/manifests/object/compatlogger.pp index a0dc5ee..00edfdf 100644 --- a/manifests/object/compatlogger.pp +++ b/manifests/object/compatlogger.pp @@ -19,7 +19,8 @@ define icinga2::object::compatlogger ( $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', - $target_file_mode = '0644' + $target_file_mode = '0644', + $refresh_icinga2_service = true ) { #Do some validation of the class' parameters: @@ -37,15 +38,33 @@ define icinga2::object::compatlogger ( validate_string($target_file_owner) validate_string($target_file_group) validate_re($target_file_mode, '^\d{4}$') + validate_bool($refresh_icinga2_service) + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_compatlogger.conf.erb'), - notify => Service['icinga2'], + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_compatlogger.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_compatlogger.conf.erb'), + } + } } diff --git a/manifests/object/dependency.pp b/manifests/object/dependency.pp index 555d77d..aa31649 100644 --- a/manifests/object/dependency.pp +++ b/manifests/object/dependency.pp @@ -25,7 +25,9 @@ define icinga2::object::dependency ( $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', - $target_file_mode = '0644') { + $target_file_mode = '0644', + $refresh_icinga2_service = true + ) { # Do some validation of the class' parameters: validate_string($object_name) validate_string($display_name) @@ -43,14 +45,33 @@ define icinga2::object::dependency ( validate_string($target_file_owner) validate_string($target_file_group) validate_string($target_file_mode) + validate_bool($refresh_icinga2_service) - file { "${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_dependency.conf.erb'), - notify => Service['icinga2'], + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_dependency.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_dependency.conf.erb'), + } + } } diff --git a/manifests/object/eventcommand.pp b/manifests/object/eventcommand.pp index d815d81..96dd3f0 100644 --- a/manifests/object/eventcommand.pp +++ b/manifests/object/eventcommand.pp @@ -24,7 +24,8 @@ define icinga2::object::eventcommand ( $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', - $target_file_mode = '0644' + $target_file_mode = '0644', + $refresh_icinga2_service = true ) { #Do some validation of the class' parameters: @@ -43,15 +44,33 @@ define icinga2::object::eventcommand ( validate_string($target_file_owner) validate_string($target_file_group) validate_re($target_file_mode, '^\d{4}$') + validate_bool($refresh_icinga2_service) + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_eventcommand.conf.erb'), - notify => Service['icinga2'], + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_eventcommand.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_eventcommand.conf.erb'), + } + } } diff --git a/manifests/object/externalcommandlistener.pp b/manifests/object/externalcommandlistener.pp index 7d9f2fd..671650a 100644 --- a/manifests/object/externalcommandlistener.pp +++ b/manifests/object/externalcommandlistener.pp @@ -18,7 +18,8 @@ define icinga2::object::externalcommandlistener ( $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', - $target_file_mode = '0644' + $target_file_mode = '0644', + $refresh_icinga2_service = true ) { #Do some validation of the class' parameters: @@ -33,15 +34,33 @@ define icinga2::object::externalcommandlistener ( validate_string($target_file_owner) validate_string($target_file_group) validate_re($target_file_mode, '^\d{4}$') + validate_bool($refresh_icinga2_service) + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_externalcommandlistener.conf.erb'), - notify => Service['icinga2'], + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_externalcommandlistener.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_externalcommandlistener.conf.erb'), + } + } } diff --git a/manifests/object/graphitewriter.pp b/manifests/object/graphitewriter.pp index cf5629b..5fd4be3 100644 --- a/manifests/object/graphitewriter.pp +++ b/manifests/object/graphitewriter.pp @@ -19,18 +19,39 @@ define icinga2::object::graphitewriter ( $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', - $target_file_mode = '0644' + $target_file_mode = '0644', + $refresh_icinga2_service = true ) { #Do some validation validate_string($host) + validate_bool($refresh_icinga2_service) + + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_graphitewriter.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_graphitewriter.conf.erb'), - notify => Service['icinga2'], } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_graphitewriter.conf.erb'), + } + + } + } diff --git a/manifests/object/host.pp b/manifests/object/host.pp index a3094e9..9937582 100644 --- a/manifests/object/host.pp +++ b/manifests/object/host.pp @@ -42,7 +42,8 @@ define icinga2::object::host ( $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', - $target_file_mode = '0644' + $target_file_mode = '0644', + $refresh_icinga2_service = true ) { #Do some validation of the class' parameters: @@ -57,14 +58,33 @@ define icinga2::object::host ( validate_string($target_file_owner) validate_string($target_file_group) validate_string($target_file_mode) + validate_bool($refresh_icinga2_service) - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_host.conf.erb'), - notify => Service['icinga2'], + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_host.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_host.conf.erb'), + } + } } diff --git a/manifests/object/hostgroup.pp b/manifests/object/hostgroup.pp index 2ded337..dde685b 100644 --- a/manifests/object/hostgroup.pp +++ b/manifests/object/hostgroup.pp @@ -21,7 +21,8 @@ define icinga2::object::hostgroup ( $target_file_group = 'root', $target_file_mode = '0644', $assign_where = undef, - $ignore_where = undef + $ignore_where = undef, + $refresh_icinga2_service = true ) { #Do some validation of the class' parameters: @@ -34,14 +35,33 @@ define icinga2::object::hostgroup ( validate_string($target_file_owner) validate_string($target_file_group) validate_string($target_file_mode) + validate_bool($refresh_icinga2_service) - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_hostgroup.conf.erb'), - notify => Service['icinga2'], + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_hostgroup.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_hostgroup.conf.erb'), + } + } } diff --git a/manifests/object/idomysqlconnection.pp b/manifests/object/idomysqlconnection.pp index d411e07..7e7eb42 100644 --- a/manifests/object/idomysqlconnection.pp +++ b/manifests/object/idomysqlconnection.pp @@ -42,7 +42,8 @@ define icinga2::object::idomysqlconnection ( $target_file_name = "${name}.conf", $target_file_owner = 'root', $target_file_group = 'root', - $target_file_mode = '0644' + $target_file_mode = '0644', + $refresh_icinga2_service = true ) { #Do some validation of the class' parameters: @@ -61,14 +62,33 @@ define icinga2::object::idomysqlconnection ( validate_string($target_file_owner) validate_string($target_file_group) validate_string($target_file_mode) + validate_bool($refresh_icinga2_service) - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_idomysqlconnection.conf.erb'), - notify => Service['icinga2'], + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_idomysqlconnection.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_idomysqlconnection.conf.erb'), + } + } } diff --git a/manifests/object/idopgsqlconnection.pp b/manifests/object/idopgsqlconnection.pp index 2a269a3..f281b99 100644 --- a/manifests/object/idopgsqlconnection.pp +++ b/manifests/object/idopgsqlconnection.pp @@ -42,7 +42,8 @@ define icinga2::object::idopgsqlconnection ( $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', - $target_file_mode = '0644' + $target_file_mode = '0644', + $refresh_icinga2_service = true ) { #Do some validation of the class' parameters: @@ -61,14 +62,33 @@ define icinga2::object::idopgsqlconnection ( validate_string($target_file_owner) validate_string($target_file_group) validate_string($target_file_mode) + validate_bool($refresh_icinga2_service) - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_idopgsqlconnection.conf.erb'), - notify => Service['icinga2'], + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_idopgsqlconnection.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_idopgsqlconnection.conf.erb'), + } + } } diff --git a/manifests/object/livestatuslistener.pp b/manifests/object/livestatuslistener.pp index 8ad7980..19290fc 100644 --- a/manifests/object/livestatuslistener.pp +++ b/manifests/object/livestatuslistener.pp @@ -10,7 +10,7 @@ # define icinga2::object::livestatuslistener ( - $object_livestatuslistenername = $name, + $object_livestatuslistenername = $name, $socket_type = undef, $bind_host = undef, $bind_port = undef, @@ -21,7 +21,8 @@ define icinga2::object::livestatuslistener ( $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', - $target_file_mode = '0644' + $target_file_mode = '0644', + $refresh_icinga2_service = true ) { #Do some validation of the class' parameters: @@ -48,15 +49,33 @@ define icinga2::object::livestatuslistener ( validate_string($target_file_owner) validate_string($target_file_group) validate_re($target_file_mode, '^\d{4}$') + validate_bool($refresh_icinga2_service) + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_livestatuslistener.conf.erb'), - notify => Service['icinga2'], + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_livestatuslistener.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_livestatuslistener.conf.erb'), + } + } } diff --git a/manifests/object/notification.pp b/manifests/object/notification.pp index bc0e678..e8d5b4e 100644 --- a/manifests/object/notification.pp +++ b/manifests/object/notification.pp @@ -27,7 +27,8 @@ define icinga2::object::notification ( $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', - $target_file_mode = '0644' + $target_file_mode = '0644', + $refresh_icinga2_service = true ) { #Do some validation of the class' parameters: @@ -66,15 +67,33 @@ define icinga2::object::notification ( validate_string($target_file_owner) validate_string($target_file_group) validate_re($target_file_mode, '^\d{4}$') + validate_bool($refresh_icinga2_service) + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_notification.conf.erb'), - notify => Service['icinga2'], + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_notification.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_notification.conf.erb'), + } + } } diff --git a/manifests/object/notificationcommand.pp b/manifests/object/notificationcommand.pp index 57bc252..d909c47 100644 --- a/manifests/object/notificationcommand.pp +++ b/manifests/object/notificationcommand.pp @@ -24,7 +24,8 @@ define icinga2::object::notificationcommand ( $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', - $target_file_mode = '0644' + $target_file_mode = '0644', + $refresh_icinga2_service = true ) { #Do some validation of the class' parameters: @@ -43,15 +44,33 @@ define icinga2::object::notificationcommand ( validate_string($target_file_owner) validate_string($target_file_group) validate_re($target_file_mode, '^\d{4}$') + validate_bool($refresh_icinga2_service) + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_notificationcommand.conf.erb'), - notify => Service['icinga2'], + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_notificationcommand.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_notificationcommand.conf.erb'), + } + } } diff --git a/manifests/object/perfdatawriter.pp b/manifests/object/perfdatawriter.pp index 4a47d17..946a8a2 100644 --- a/manifests/object/perfdatawriter.pp +++ b/manifests/object/perfdatawriter.pp @@ -24,7 +24,8 @@ define icinga2::object::perfdatawriter ( $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', - $target_file_mode = '0644' + $target_file_mode = '0644', + $refresh_icinga2_service = true ) { #Do some validation of the class' parameters: @@ -57,15 +58,33 @@ define icinga2::object::perfdatawriter ( validate_string($target_file_owner) validate_string($target_file_group) validate_re($target_file_mode, '^\d{4}$') + validate_bool($refresh_icinga2_service) + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_perfdatawriter.conf.erb'), - notify => Service['icinga2'], + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_perfdatawriter.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_perfdatawriter.conf.erb'), + } + } } diff --git a/manifests/object/scheduleddowntime.pp b/manifests/object/scheduleddowntime.pp index 9d0a87b..1b3c7fb 100644 --- a/manifests/object/scheduleddowntime.pp +++ b/manifests/object/scheduleddowntime.pp @@ -23,7 +23,8 @@ define icinga2::object::scheduleddowntime ( $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', - $target_file_mode = '0644' + $target_file_mode = '0644', + $refresh_icinga2_service = true ) { #Do some validation of the define's parameters: @@ -42,14 +43,33 @@ define icinga2::object::scheduleddowntime ( validate_string($target_file_owner) validate_string($target_file_group) validate_string($target_file_mode) + validate_bool($refresh_icinga2_service) - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_scheduleddowntime.conf.erb'), - notify => Service['icinga2'], + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_scheduleddowntime.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_scheduleddowntime.conf.erb'), + } + } } diff --git a/manifests/object/service.pp b/manifests/object/service.pp index 9cf7a82..e6af2da 100644 --- a/manifests/object/service.pp +++ b/manifests/object/service.pp @@ -41,7 +41,8 @@ define icinga2::object::service ( $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', - $target_file_mode = '0644' + $target_file_mode = '0644', + $refresh_icinga2_service = true ) { #Do some validation of the class' parameters: @@ -56,14 +57,33 @@ define icinga2::object::service ( validate_string($target_file_owner) validate_string($target_file_group) validate_string($target_file_mode) + validate_bool($refresh_icinga2_service) - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_service.conf.erb'), - notify => Service['icinga2'], + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_service.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_service.conf.erb'), + } + } } diff --git a/manifests/object/servicegroup.pp b/manifests/object/servicegroup.pp index 2b9b260..2650fed 100644 --- a/manifests/object/servicegroup.pp +++ b/manifests/object/servicegroup.pp @@ -21,7 +21,8 @@ define icinga2::object::servicegroup ( $target_file_group = 'root', $target_file_mode = '0644', $assign_where = undef, - $ignore_where = undef + $ignore_where = undef, + $refresh_icinga2_service = true ) { #Do some validation of the class' parameters: @@ -34,14 +35,33 @@ define icinga2::object::servicegroup ( validate_string($target_file_owner) validate_string($target_file_group) validate_string($target_file_mode) + validate_bool($refresh_icinga2_service) - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_servicegroup.conf.erb'), - notify => Service['icinga2'], + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_servicegroup.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_servicegroup.conf.erb'), + } + } } diff --git a/manifests/object/statusdatawriter.pp b/manifests/object/statusdatawriter.pp index 563e11c..34fd8a2 100644 --- a/manifests/object/statusdatawriter.pp +++ b/manifests/object/statusdatawriter.pp @@ -19,7 +19,8 @@ define icinga2::object::statusdatawriter ( $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', - $target_file_mode = '0644' + $target_file_mode = '0644', + $refresh_icinga2_service = true ) { #Do some validation of the class' parameters: @@ -40,15 +41,33 @@ define icinga2::object::statusdatawriter ( validate_string($target_file_owner) validate_string($target_file_group) validate_re($target_file_mode, '^\d{4}$') + validate_bool($refresh_icinga2_service) + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_statusdatawriter.conf.erb'), - notify => Service['icinga2'], + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_statusdatawriter.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_statusdatawriter.conf.erb'), + } + } } diff --git a/manifests/object/sysloglogger.pp b/manifests/object/sysloglogger.pp index 7ad8f02..fd72091 100644 --- a/manifests/object/sysloglogger.pp +++ b/manifests/object/sysloglogger.pp @@ -17,7 +17,8 @@ define icinga2::object::sysloglogger ( $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', - $target_file_mode = '0644' + $target_file_mode = '0644', + $refresh_icinga2_service = true ) { #Do some validation of the class' parameters: @@ -28,14 +29,33 @@ define icinga2::object::sysloglogger ( validate_string($target_file_owner) validate_string($target_file_group) validate_string($target_file_mode) + validate_bool($refresh_icinga2_service) - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_sysloglogger.conf.erb'), - notify => Service['icinga2'], + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_sysloglogger.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_sysloglogger.conf.erb'), + } + } } diff --git a/manifests/object/timeperiod.pp b/manifests/object/timeperiod.pp index ccf8d21..7643384 100644 --- a/manifests/object/timeperiod.pp +++ b/manifests/object/timeperiod.pp @@ -15,12 +15,13 @@ define icinga2::object::timeperiod ( $timeperiod_display_name = undef, $methods = undef, $ranges = {}, - $timeperiod_target_dir = '/etc/icinga2/objects/timeperiods', - $timeperiod_target_file_name = "${name}.conf", + $target_dir = '/etc/icinga2/objects/timeperiods', + $target_file_name = "${name}.conf", $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', $target_file_mode = '0644', + $refresh_icinga2_service = true ) { # Do some validation of the class' parameters: @@ -36,13 +37,33 @@ define icinga2::object::timeperiod ( validate_string($target_file_owner) validate_string($target_file_group) validate_re($target_file_mode, '^\d{4}$') + validate_bool($refresh_icinga2_service) + + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_timeperiod.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } - file {"${timeperiod_target_dir}/${timeperiod_target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_timeperiod.conf.erb'), - notify => Service['icinga2'], } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_timeperiod.conf.erb'), + } + + } + } diff --git a/manifests/object/user.pp b/manifests/object/user.pp index bb6f0ac..21ea6d7 100644 --- a/manifests/object/user.pp +++ b/manifests/object/user.pp @@ -25,7 +25,8 @@ define icinga2::object::user ( $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', - $target_file_mode = '0644' + $target_file_mode = '0644', + $refresh_icinga2_service = true ) { #Do some validation of the class' parameters: @@ -41,14 +42,33 @@ define icinga2::object::user ( validate_string($target_file_owner) validate_string($target_file_group) validate_string($target_file_mode) + validate_bool($refresh_icinga2_service) - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_user.conf.erb'), - notify => Service['icinga2'], + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_user.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_user.conf.erb'), + } + } } diff --git a/manifests/object/usergroup.pp b/manifests/object/usergroup.pp index 9137450..7c96545 100644 --- a/manifests/object/usergroup.pp +++ b/manifests/object/usergroup.pp @@ -21,7 +21,8 @@ define icinga2::object::usergroup ( $target_file_group = 'root', $target_file_mode = '0644', $assign_where = undef, - $ignore_where = undef + $ignore_where = undef, + $refresh_icinga2_service = true ) { #Do some validation of the class' parameters: @@ -33,14 +34,33 @@ define icinga2::object::usergroup ( validate_string($target_file_owner) validate_string($target_file_group) validate_string($target_file_mode) + validate_bool($refresh_icinga2_service) - file {"${target_dir}/${target_file_name}": - ensure => $target_file_ensure, - owner => $target_file_owner, - group => $target_file_group, - mode => $target_file_mode, - content => template('icinga2/object_usergroup.conf.erb'), - notify => Service['icinga2'], + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_usergroup.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_usergroup.conf.erb'), + } + } } From 9da1176b2975ffe31bc76778ebb646146e9dd02a Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Mon, 1 Dec 2014 21:42:57 -0800 Subject: [PATCH 07/79] CHANGELOG update for https://dev.icinga.org/issues/7856 refs #7856 : https://dev.icinga.org/issues/7856 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67c8cbf..579c7fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Feature: [PR-54](https://github.com/Icinga/puppet-icinga2/pull/54) and [dev.icinga.org issue #7225](https://dev.icinga.org/issues/7225): Added a CompatLogger object defined type. * Feature: [PR-55](https://github.com/Icinga/puppet-icinga2/pull/55) and [dev.icinga.org issue #7226](https://dev.icinga.org/issues/7226): Added a CheckResultReader object defined type. * Feature: Added a parameter that controls whether to purge unmanaged files in `/etc/icinga2/objects/` +* Feature: [dev.icinga.org issue #7856](https://dev.icinga.org/issues/7856): Added a parameter to each object defined type that can controle whether the Icinga 2 service gets refreshed; it can be set to false if the module is being used to just generate object definition files and isn't managing the service ###v0.6.0 (November 19th, 2014) From 0c925229ef6a6b80963fcda8598e5eb3981b9c3e Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Mon, 1 Dec 2014 21:49:33 -0800 Subject: [PATCH 08/79] Added a README note about the refresh_icinga2_service parameter. refs#7856 : https://dev.icinga.org/issues/7856 --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 7de8f4e..779a381 100644 --- a/README.md +++ b/README.md @@ -373,6 +373,21 @@ This means that they will not be added to the rendered object definition files. **However**, this doesn't mean that the values are undefined in Icinga 2. Icinga 2 itself has built-in default values for many object parameters and falls back to them if one isn't present in an object definition. See the docs for individual object types in [Configuring Icinga 2](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc#!/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2) for more info about which object parameters have what default values. +####Notifying the Icinga 2 service + +By default, each object defined type will automatically notify and restart the Icinga 2 service. However, if you're using the module to just generate object files and not using it to manage the service, you'll likely get compilation errors about the `icinga2` service not being in the catalog. + +Each object defined type has a boolean parameter, `refresh_icinga2_service`, that controls whether the object file will notify the service. To **not** notify the service, set it to `false`: + +
+icinga2::object::apply_dependency { 'usermail_dep_on_icinga2mail':
+  parent_host_name => 'icinga2mail.local',
+  target_file_owner => vagrant,
+  assign_where => 'match("^usermail*", host.name)',
+  refresh_icinga2_service => false,
+}
+
+ ####[Objects](id:objects) Object types: From df0b3c041044f13efe739b12a9d626aaee0ff37d Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Tue, 2 Dec 2014 21:41:01 -0800 Subject: [PATCH 09/79] CHANGELOG release version date. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 579c7fc..e864f43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ #Changelog - - - -###v0.6.1 (unreleased) +###v0.6.1 (December 2nd, 2014) * Feature: [PR-54](https://github.com/Icinga/puppet-icinga2/pull/54) and [dev.icinga.org issue #7225](https://dev.icinga.org/issues/7225): Added a CompatLogger object defined type. * Feature: [PR-55](https://github.com/Icinga/puppet-icinga2/pull/55) and [dev.icinga.org issue #7226](https://dev.icinga.org/issues/7226): Added a CheckResultReader object defined type. From cab5245c14dc016e5f2d73bd6b129309397407f7 Mon Sep 17 00:00:00 2001 From: Nicolas Bigler Date: Tue, 25 Nov 2014 19:07:12 +0100 Subject: [PATCH 10/79] Update object_host.conf.erb Added routine for cases where the value of a vars variable is a hash. Merged from: https://github.com/Icinga/puppet-icinga2/pull/58 refs#8156: https://dev.icinga.org/issues/8156 --- templates/object_host.conf.erb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/templates/object_host.conf.erb b/templates/object_host.conf.erb index cc5c1ab..727591a 100644 --- a/templates/object_host.conf.erb +++ b/templates/object_host.conf.erb @@ -30,9 +30,18 @@ object Host "<%= @object_hostname %>" { <%- end -%> <%- if @vars.empty? != true -%> <%- @vars.each_pair do |key, value| -%> + <%- @vars.each_pair do |key,value| -%> + <%- if value.is_a?(Hash) -%> + vars.<%= key %> = { + <%- value.each_pair do |subkey,subvalue|-%> + <%= subkey %> = <%= subvalue %> + <%- end -%> + } + <%- else -%> vars.<%= key %> = "<%= value %>" <%- end -%> <%- end -%> + <%- end -%> <%- if @check_command -%> check_command = "<%= @check_command -%>" <%- end -%> From b8d3a83b2a8724493244dce1096e35c7db27105f Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sat, 3 Jan 2015 21:42:26 -0800 Subject: [PATCH 11/79] Changelog update. refs#8156: https://dev.icinga.org/issues/8156 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e864f43..9598c88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ #Changelog - - - +###v0.6.2 (unreleased) + +* Feature: [PR-58](https://github.com/Icinga/puppet-icinga2/pull/58) and [dev.icinga.org issue #8156](https://dev.icinga.org/issues/8156): Added the ability to use hashes directly in host `vars` parameters (instead of rendering hashes into a series of `vars.` lines in the rendered object file). + ###v0.6.1 (December 2nd, 2014) * Feature: [PR-54](https://github.com/Icinga/puppet-icinga2/pull/54) and [dev.icinga.org issue #7225](https://dev.icinga.org/issues/7225): Added a CompatLogger object defined type. From ce3bd25fe9b8c9f5f217b98197c0c718e0c64dd9 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sat, 3 Jan 2015 22:29:30 -0800 Subject: [PATCH 12/79] Removed an extra .each line. --- templates/object_host.conf.erb | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/object_host.conf.erb b/templates/object_host.conf.erb index 727591a..3a779c7 100644 --- a/templates/object_host.conf.erb +++ b/templates/object_host.conf.erb @@ -30,7 +30,6 @@ object Host "<%= @object_hostname %>" { <%- end -%> <%- if @vars.empty? != true -%> <%- @vars.each_pair do |key, value| -%> - <%- @vars.each_pair do |key,value| -%> <%- if value.is_a?(Hash) -%> vars.<%= key %> = { <%- value.each_pair do |subkey,subvalue|-%> From 6646b3b39225256de8a42c2493bb6fb5e1828487 Mon Sep 17 00:00:00 2001 From: "ricardo@cropalato.com.br" Date: Wed, 26 Nov 2014 08:44:15 -0500 Subject: [PATCH 13/79] Adding EndPoint Object. #7232 Merged from: https://github.com/Icinga/puppet-icinga2/pull/63 refs#7232: https://dev.icinga.org/issues/7232 --- README.md | 14 +++++++++ manifests/object/endpoint.pp | 46 ++++++++++++++++++++++++++++++ templates/object_endpoint.conf.erb | 21 ++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 manifests/object/endpoint.pp create mode 100644 templates/object_endpoint.conf.erb diff --git a/README.md b/README.md index 779a381..d4fb847 100644 --- a/README.md +++ b/README.md @@ -398,6 +398,7 @@ Object types: * [icinga2::object::checkcommand](#icinga2objectcheckcommand) * [icinga2::object::compatlogger](#icinga2objectcompatlogger) * [icinga2::object::checkresultreader](#icinga2objectcheckresultreader) +* [icinga2::object::endpoint](#icinga2objectendpoint) * [icinga2::object::eventcommand](#icinga2objecteventcommand) * [icinga2::object::externalcommandlistener](#icinga2objectexternalcommandlistener) * [icinga2::object::host](#icinga2objecthost) @@ -567,6 +568,19 @@ icinga2::object::checkresultreader {'reader': See [CheckResultReader](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-checkresultreader) on [docs.icinga.org](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc) for a full list of parameters. +####`[icinga2::object::endpoint]`(id:object_endpoint) + +The `endpoint` defined type can create `endpoint` objects. + +
+icinga2::object::endpoint { 'icinga2b':
+  host => '192.168.5.46',
+  port => 5665
+}
+
+ +See [EndPoint](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-endpoint) on [docs.icinga.org](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc) for a full list of parameters. + ####`icinga2::object::eventcommand` The `eventcommand` defined type can create `eventcommand` objects. diff --git a/manifests/object/endpoint.pp b/manifests/object/endpoint.pp new file mode 100644 index 0000000..8e0ab90 --- /dev/null +++ b/manifests/object/endpoint.pp @@ -0,0 +1,46 @@ +# == Defined type: icinga2::object::endpoint +# +# This is a defined type for Icinga 2 apply objects that create EndPoint +# See the following Icinga 2 doc page for more info: +# http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-endpoint +# +# === Parameters +# +# See the inline comments. +# + +define icinga2::object::endpoint ( + $ensure = 'file', + $object_name = $name, + $host = undef, + $port = undef, + $log_duration = undef, + $target_dir = '/etc/icinga2/object/endpoints', + $target_file_name = "${object_name}.conf", + $target_file_owner = 'root', + $target_file_group = 'root', + $target_file_mode = '0644' +) { + + validate_string($host) + if $port { + validate_re($port, '^\d{1,5}$') + } + if $log_duration { + validate_string($log_duration) + } + validate_string($target_dir) + validate_string($target_file_name) + validate_string($target_file_owner) + validate_string($target_file_group) + validate_re($target_file_mode, '^\d{4}$') + + file {"${target_dir}/${target_file_name}": + ensure => $ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_endpoint.conf.erb'), + notify => Service['icinga2'], + } +} diff --git a/templates/object_endpoint.conf.erb b/templates/object_endpoint.conf.erb new file mode 100644 index 0000000..fd51e00 --- /dev/null +++ b/templates/object_endpoint.conf.erb @@ -0,0 +1,21 @@ +/** +* WARNING: This EndPoint is automatically generated by Puppet. +* ANY MANUAL CHANGES TO IT WILL GET OVERWRITTEN! +*/ + +/** +* A EndPoint definition. You can create your own configuration files +* in the conf.d directory (e.g. one per commnand). By default all *.conf +* files in this directory are included. +* +*/ + +object EndPoint "<%= @object_name %>" { + host = "<%= @host -%>" + <%- if @port -%> + port = <%= @port -%> + <%- end -%> + <%- if @log_duration -%> + log_duration = <%= @log_duration -%> + <%- end -%> +} From 85bd8429f5ad02cc05573d13270cad1d859cb4e6 Mon Sep 17 00:00:00 2001 From: "ricardo@cropalato.com.br" Date: Wed, 26 Nov 2014 08:46:26 -0500 Subject: [PATCH 14/79] * fixed typo Merged from: https://github.com/Icinga/puppet-icinga2/pull/63 refs#7232: https://dev.icinga.org/issues/7232 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d4fb847..8d93089 100644 --- a/README.md +++ b/README.md @@ -568,7 +568,7 @@ icinga2::object::checkresultreader {'reader': See [CheckResultReader](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-checkresultreader) on [docs.icinga.org](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc) for a full list of parameters. -####`[icinga2::object::endpoint]`(id:object_endpoint) +####`[icinga2::object::endpoint]`(id:icinga2objectendpoint) The `endpoint` defined type can create `endpoint` objects. From cb86883443056c8cab44141772b47e86b1f3555e Mon Sep 17 00:00:00 2001 From: "ricardo@cropalato.com.br" Date: Wed, 26 Nov 2014 08:48:53 -0500 Subject: [PATCH 15/79] * fixed typo Merged from: https://github.com/Icinga/puppet-icinga2/pull/63 refs#7232: https://dev.icinga.org/issues/7232 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8d93089..4599a94 100644 --- a/README.md +++ b/README.md @@ -568,7 +568,7 @@ icinga2::object::checkresultreader {'reader': See [CheckResultReader](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-checkresultreader) on [docs.icinga.org](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc) for a full list of parameters. -####`[icinga2::object::endpoint]`(id:icinga2objectendpoint) +####[`icinga2::object::endpoint`](id:object_endpoint) The `endpoint` defined type can create `endpoint` objects. From c8d2286428a169786416f2005fcd03452ce7aa1e Mon Sep 17 00:00:00 2001 From: Ricardo Melo Date: Tue, 2 Dec 2014 15:31:11 -0500 Subject: [PATCH 16/79] * fixed default parameter value Merged from: https://github.com/Icinga/puppet-icinga2/pull/63 refs#7232: https://dev.icinga.org/issues/7232 --- manifests/object/endpoint.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/object/endpoint.pp b/manifests/object/endpoint.pp index 8e0ab90..3ee04b2 100644 --- a/manifests/object/endpoint.pp +++ b/manifests/object/endpoint.pp @@ -16,7 +16,7 @@ define icinga2::object::endpoint ( $port = undef, $log_duration = undef, $target_dir = '/etc/icinga2/object/endpoints', - $target_file_name = "${object_name}.conf", + $target_file_name = "${name}.conf", $target_file_owner = 'root', $target_file_group = 'root', $target_file_mode = '0644' From a429a76527f5e01cdd05b934972a8d80f75581eb Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sun, 4 Jan 2015 15:21:13 -0800 Subject: [PATCH 17/79] Fixed a typo in the ERB template for the Endpoint object. 'Endpoint' should only have a capital E, not a capital P. --- templates/object_endpoint.conf.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/object_endpoint.conf.erb b/templates/object_endpoint.conf.erb index fd51e00..d367e15 100644 --- a/templates/object_endpoint.conf.erb +++ b/templates/object_endpoint.conf.erb @@ -10,7 +10,7 @@ * */ -object EndPoint "<%= @object_name %>" { +object Endpoint "<%= @object_name %>" { host = "<%= @host -%>" <%- if @port -%> port = <%= @port -%> From 21ad7c2433484d7db6f4c43ef2c44f763adcef14 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sun, 4 Jan 2015 15:23:28 -0800 Subject: [PATCH 18/79] Fixed typo in file path. --- manifests/object/endpoint.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/object/endpoint.pp b/manifests/object/endpoint.pp index 3ee04b2..3ea419f 100644 --- a/manifests/object/endpoint.pp +++ b/manifests/object/endpoint.pp @@ -15,7 +15,7 @@ define icinga2::object::endpoint ( $host = undef, $port = undef, $log_duration = undef, - $target_dir = '/etc/icinga2/object/endpoints', + $target_dir = '/etc/icinga2/objects/endpoints', $target_file_name = "${name}.conf", $target_file_owner = 'root', $target_file_group = 'root', From 14c2284c455d78232ce94311230696c56d8acfb4 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sun, 4 Jan 2015 15:36:21 -0800 Subject: [PATCH 19/79] Changelog update. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9598c88..9769baf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ###v0.6.2 (unreleased) * Feature: [PR-58](https://github.com/Icinga/puppet-icinga2/pull/58) and [dev.icinga.org issue #8156](https://dev.icinga.org/issues/8156): Added the ability to use hashes directly in host `vars` parameters (instead of rendering hashes into a series of `vars.` lines in the rendered object file). +* Feature: [PR-63](https://github.com/Icinga/puppet-icinga2/pull/63) and [dev.icinga.org issue #7232](https://dev.icinga.org/issues/7232): Added an Endpoint object defined type. ###v0.6.1 (December 2nd, 2014) From ba1070a71688b45ca127083321b740a3515a41a2 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sun, 4 Jan 2015 15:49:49 -0800 Subject: [PATCH 20/79] Changelog update. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9769baf..a9390a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Feature: [PR-58](https://github.com/Icinga/puppet-icinga2/pull/58) and [dev.icinga.org issue #8156](https://dev.icinga.org/issues/8156): Added the ability to use hashes directly in host `vars` parameters (instead of rendering hashes into a series of `vars.` lines in the rendered object file). * Feature: [PR-63](https://github.com/Icinga/puppet-icinga2/pull/63) and [dev.icinga.org issue #7232](https://dev.icinga.org/issues/7232): Added an Endpoint object defined type. +* Feature: [PR-62](https://github.com/Icinga/puppet-icinga2/pull/62) and [dev.icinga.org issue #7230](https://dev.icinga.org/issues/7230): Added an IcingaStatusWriter object defined type. ###v0.6.1 (December 2nd, 2014) From 9b182e6de5d85e0028c86d5384bb067e5fbf53fc Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sun, 4 Jan 2015 15:54:34 -0800 Subject: [PATCH 21/79] Changelog update. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9390a6..778fd46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Feature: [PR-58](https://github.com/Icinga/puppet-icinga2/pull/58) and [dev.icinga.org issue #8156](https://dev.icinga.org/issues/8156): Added the ability to use hashes directly in host `vars` parameters (instead of rendering hashes into a series of `vars.` lines in the rendered object file). * Feature: [PR-63](https://github.com/Icinga/puppet-icinga2/pull/63) and [dev.icinga.org issue #7232](https://dev.icinga.org/issues/7232): Added an Endpoint object defined type. * Feature: [PR-62](https://github.com/Icinga/puppet-icinga2/pull/62) and [dev.icinga.org issue #7230](https://dev.icinga.org/issues/7230): Added an IcingaStatusWriter object defined type. +* Feature: [PR-61](https://github.com/Icinga/puppet-icinga2/pull/61) and [dev.icinga.org issue #7229](https://dev.icinga.org/issues/7229): Added an FileLogger object defined type. ###v0.6.1 (December 2nd, 2014) From 2bf06c72871e9b3d7a122873d9460a67bd22bd87 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sun, 4 Jan 2015 16:10:19 -0800 Subject: [PATCH 22/79] typo. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 778fd46..b298d4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ * Feature: [PR-58](https://github.com/Icinga/puppet-icinga2/pull/58) and [dev.icinga.org issue #8156](https://dev.icinga.org/issues/8156): Added the ability to use hashes directly in host `vars` parameters (instead of rendering hashes into a series of `vars.` lines in the rendered object file). * Feature: [PR-63](https://github.com/Icinga/puppet-icinga2/pull/63) and [dev.icinga.org issue #7232](https://dev.icinga.org/issues/7232): Added an Endpoint object defined type. * Feature: [PR-62](https://github.com/Icinga/puppet-icinga2/pull/62) and [dev.icinga.org issue #7230](https://dev.icinga.org/issues/7230): Added an IcingaStatusWriter object defined type. -* Feature: [PR-61](https://github.com/Icinga/puppet-icinga2/pull/61) and [dev.icinga.org issue #7229](https://dev.icinga.org/issues/7229): Added an FileLogger object defined type. +* Feature: [PR-61](https://github.com/Icinga/puppet-icinga2/pull/61) and [dev.icinga.org issue #7229](https://dev.icinga.org/issues/7229): Added a FileLogger object defined type. ###v0.6.1 (December 2nd, 2014) From 38d1ac911a81e0ff3a4934c795e01bb85d2cca4e Mon Sep 17 00:00:00 2001 From: "ricardo@cropalato.com.br" Date: Wed, 26 Nov 2014 08:19:27 -0500 Subject: [PATCH 23/79] Adding IcingaStatusWriter object. #7230 --- README.md | 15 +++++++ manifests/object/icingastatuswriter.pp | 44 ++++++++++++++++++++ templates/object_icingastatuswriter.conf.erb | 20 +++++++++ 3 files changed, 79 insertions(+) create mode 100644 manifests/object/icingastatuswriter.pp create mode 100644 templates/object_icingastatuswriter.conf.erb diff --git a/README.md b/README.md index 4599a94..3773d04 100644 --- a/README.md +++ b/README.md @@ -403,6 +403,7 @@ Object types: * [icinga2::object::externalcommandlistener](#icinga2objectexternalcommandlistener) * [icinga2::object::host](#icinga2objecthost) * [icinga2::object::hostgroup](#icinga2objecthostgroup) +* [icinga2::object::icingastatuswriter](#icinga2objecticingastatuswriter) * [icinga2::object::idomysqlconnection](#icinga2objectidomysqlconnection) * [icinga2::object::idopgsqlconnection](#icinga2objectidopgsqlconnection) * [icinga2::object::livestatuslistener](#icinga2objectlivestatuslistener) @@ -649,6 +650,20 @@ If you would like to use an IPv6 address, make sure to set the `ipv6_address` pa Coming soon... +####[`icinga2::object::icingastatuswriter`](id:object_icingastatuswriter) + +This defined type creates an **IcingaStatusWriter** objects. + +Example usage: +
+icinga2::object::icingastatuswriter { 'status':
+   status_path       => '/cache/icinga2/status.json',
+   update_interval   => '15s',
+}
+
+ +See [IcingaStatusWriter](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-icingastatuswriter) on [docs.icinga.org](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc) for more details about the object. + ####[`icinga2::object::idomysqlconnection`](id:object_idomysqlconnection) This defined type creates an **IdoMySqlConnection** objects. diff --git a/manifests/object/icingastatuswriter.pp b/manifests/object/icingastatuswriter.pp new file mode 100644 index 0000000..61fdb69 --- /dev/null +++ b/manifests/object/icingastatuswriter.pp @@ -0,0 +1,44 @@ +# == Defined type: icinga2::object::icingastatuswriter +# +# This is a defined type for Icinga 2 apply objects that create IcingaStatusWriter +# See the following Icinga 2 doc page for more info: +# http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-checkercomponent +# +# === Parameters +# +# See the inline comments. +# + +define icinga2::object::icingastatuswriter ( + $ensure = 'file', + $object_name = $name, + $status_path = undef, + $update_internal = undef, + $target_dir = '/etc/icinga2/objects/icingastatuswriters', + $target_file_name = "${name}.conf", + $target_file_owner = 'root', + $target_file_group = 'root', + $target_file_mode = '0644' +) { + + if $status_path { + validate_string($status_path) + } + if $update_internal { + validate_string($update_internal) + } + validate_string($target_dir) + validate_string($target_file_name) + validate_string($target_file_owner) + validate_string($target_file_group) + validate_re($target_file_mode, '^\d{4}$') + + file {"${target_dir}/${target_file_name}": + ensure => $ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_icingastatuswriter.conf.erb'), + notify => Service['icinga2'], + } +} diff --git a/templates/object_icingastatuswriter.conf.erb b/templates/object_icingastatuswriter.conf.erb new file mode 100644 index 0000000..6dad90f --- /dev/null +++ b/templates/object_icingastatuswriter.conf.erb @@ -0,0 +1,20 @@ +/** +* WARNING: This IcingaStatusWriter is automatically generated by Puppet. +* ANY MANUAL CHANGES TO IT WILL GET OVERWRITTEN! +*/ + +/** +* A IcingaStatusWriter definition. You can create your own configuration files +* in the conf.d directory (e.g. one per commnand). By default all *.conf +* files in this directory are included. +* +*/ + +object IcingaStatusWriter "<%= @object_name %>" { +<%- if @status_path -%> + status_path = LocalStateDir + "<%= @status_path -%>" +<%- end -%> +<%- if @update_interval -%> + update_interval = <%= @update_interval -%> +<%- end -%> +} From 152fc7e06584bc2c5c60bec4f347fa30bafddc67 Mon Sep 17 00:00:00 2001 From: Ricardo Melo Date: Tue, 2 Dec 2014 15:28:33 -0500 Subject: [PATCH 24/79] * fixed typo --- manifests/object/icingastatuswriter.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/object/icingastatuswriter.pp b/manifests/object/icingastatuswriter.pp index 61fdb69..9dcd87f 100644 --- a/manifests/object/icingastatuswriter.pp +++ b/manifests/object/icingastatuswriter.pp @@ -13,7 +13,7 @@ define icinga2::object::icingastatuswriter ( $ensure = 'file', $object_name = $name, $status_path = undef, - $update_internal = undef, + $update_interval = undef, $target_dir = '/etc/icinga2/objects/icingastatuswriters', $target_file_name = "${name}.conf", $target_file_owner = 'root', @@ -24,8 +24,8 @@ define icinga2::object::icingastatuswriter ( if $status_path { validate_string($status_path) } - if $update_internal { - validate_string($update_internal) + if $update_interval { + validate_string($update_interval) } validate_string($target_dir) validate_string($target_file_name) From 255f70d5228b392f955edf879346ff49c6030259 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sun, 4 Jan 2015 15:49:49 -0800 Subject: [PATCH 25/79] Changelog update. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9769baf..a9390a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Feature: [PR-58](https://github.com/Icinga/puppet-icinga2/pull/58) and [dev.icinga.org issue #8156](https://dev.icinga.org/issues/8156): Added the ability to use hashes directly in host `vars` parameters (instead of rendering hashes into a series of `vars.` lines in the rendered object file). * Feature: [PR-63](https://github.com/Icinga/puppet-icinga2/pull/63) and [dev.icinga.org issue #7232](https://dev.icinga.org/issues/7232): Added an Endpoint object defined type. +* Feature: [PR-62](https://github.com/Icinga/puppet-icinga2/pull/62) and [dev.icinga.org issue #7230](https://dev.icinga.org/issues/7230): Added an IcingaStatusWriter object defined type. ###v0.6.1 (December 2nd, 2014) From 9ed54ac1c4c3cc9e95ed49af30474322991c5cb1 Mon Sep 17 00:00:00 2001 From: "ricardo@cropalato.com.br" Date: Wed, 26 Nov 2014 07:51:44 -0500 Subject: [PATCH 26/79] Adding FileLogger object. #7229. --- README.md | 16 ++++++++++ manifests/object/filelogger.pp | 45 ++++++++++++++++++++++++++++ templates/object_filelogger.conf.erb | 18 +++++++++++ 3 files changed, 79 insertions(+) create mode 100644 manifests/object/filelogger.pp create mode 100644 templates/object_filelogger.conf.erb diff --git a/README.md b/README.md index 3773d04..81051aa 100644 --- a/README.md +++ b/README.md @@ -401,6 +401,7 @@ Object types: * [icinga2::object::endpoint](#icinga2objectendpoint) * [icinga2::object::eventcommand](#icinga2objecteventcommand) * [icinga2::object::externalcommandlistener](#icinga2objectexternalcommandlistener) +* [icinga2::object::filelogger](#icinga2objectfilelogger) * [icinga2::object::host](#icinga2objecthost) * [icinga2::object::hostgroup](#icinga2objecthostgroup) * [icinga2::object::icingastatuswriter](#icinga2objecticingastatuswriter) @@ -608,6 +609,21 @@ icinga2::object::externalcommandlistener { 'external': See [ExternalCommandListener](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-externalcommandlistener) on [docs.icinga.org](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc) for a full list of parameters. +####[`icinga2::object::filelogger`](id:object_filelogger) + +This defined type creates file logger objects. + +Example: + +
+icinga2::object::filelogger { 'debug-file':
+  severity => 'debug',
+  path     => '/var/log/icinga2/debug.log',
+}
+
+ +See [FileLogger](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-filelogger) on [docs.icinga.org](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc) for a full list of parameters. + ####[`icinga2::object::host`](id:object_host) This defined type creates host objects. diff --git a/manifests/object/filelogger.pp b/manifests/object/filelogger.pp new file mode 100644 index 0000000..43e0154 --- /dev/null +++ b/manifests/object/filelogger.pp @@ -0,0 +1,45 @@ +# == Defined type: icinga2::object::filelogger +# +# This is a defined type for Icinga 2 apply objects that create File Logger +# See the following Icinga 2 doc page for more info: +# http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-filelogger +# +# === Parameters +# +# See the inline comments. +# + +define icinga2::object::filelogger ( + $ensure = 'file', + $object_name = $name, + $path = undef, + $severity = undef, + $target_dir = '/etc/icinga2/conf.d', + $target_file_name = "${object_name}.conf", + $target_file_owner = 'root', + $target_file_group = 'root', + $target_file_mode = '0644' +) { + + if $object_name { + validate_string($object_name) + } + validate_string($path) + if $severity { + validate_string($severity) + } + validate_string($target_dir) + validate_string($target_file_name) + validate_string($target_file_owner) + validate_string($target_file_group) + validate_re($target_file_mode, '^\d{4}$') + + file {"${target_dir}/${target_file_name}": + ensure => $ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_filelogger.conf.erb'), + notify => Service['icinga2'] + } +} diff --git a/templates/object_filelogger.conf.erb b/templates/object_filelogger.conf.erb new file mode 100644 index 0000000..aab83ef --- /dev/null +++ b/templates/object_filelogger.conf.erb @@ -0,0 +1,18 @@ +/** +* WARNING: This FileLogger is automatically generated by Puppet. +* ANY MANUAL CHANGES TO IT WILL GET OVERWRITTEN! +*/ + +/** +* A FileLogger definition. You can create your own configuration files +* in the conf.d directory (e.g. one per commnand). By default all *.conf +* files in this directory are included. +* +*/ + +object FileLogger "<%= @object_name %>" { + <%- if @severity -%> + severity = "<%= severity -%>" + <%- end -%> + path = "<%= @path -%>" +} From fc138d20f7e6a4d6a5ea91e907bcd7c5c804c739 Mon Sep 17 00:00:00 2001 From: Ricardo Melo Date: Tue, 2 Dec 2014 15:15:31 -0500 Subject: [PATCH 27/79] * fixed default parameter value --- manifests/object/filelogger.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/object/filelogger.pp b/manifests/object/filelogger.pp index 43e0154..1f7c98c 100644 --- a/manifests/object/filelogger.pp +++ b/manifests/object/filelogger.pp @@ -15,7 +15,7 @@ define icinga2::object::filelogger ( $path = undef, $severity = undef, $target_dir = '/etc/icinga2/conf.d', - $target_file_name = "${object_name}.conf", + $target_file_name = "${name}.conf", $target_file_owner = 'root', $target_file_group = 'root', $target_file_mode = '0644' From 10c49255fea1c5a302ac1790de8f47e714c0ae02 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sun, 4 Jan 2015 15:54:34 -0800 Subject: [PATCH 28/79] Changelog update. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9390a6..778fd46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Feature: [PR-58](https://github.com/Icinga/puppet-icinga2/pull/58) and [dev.icinga.org issue #8156](https://dev.icinga.org/issues/8156): Added the ability to use hashes directly in host `vars` parameters (instead of rendering hashes into a series of `vars.` lines in the rendered object file). * Feature: [PR-63](https://github.com/Icinga/puppet-icinga2/pull/63) and [dev.icinga.org issue #7232](https://dev.icinga.org/issues/7232): Added an Endpoint object defined type. * Feature: [PR-62](https://github.com/Icinga/puppet-icinga2/pull/62) and [dev.icinga.org issue #7230](https://dev.icinga.org/issues/7230): Added an IcingaStatusWriter object defined type. +* Feature: [PR-61](https://github.com/Icinga/puppet-icinga2/pull/61) and [dev.icinga.org issue #7229](https://dev.icinga.org/issues/7229): Added an FileLogger object defined type. ###v0.6.1 (December 2nd, 2014) From b6ff3da4b3e75324939b19cfebe8f0c81837249e Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sun, 4 Jan 2015 16:10:19 -0800 Subject: [PATCH 29/79] typo. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 778fd46..b298d4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ * Feature: [PR-58](https://github.com/Icinga/puppet-icinga2/pull/58) and [dev.icinga.org issue #8156](https://dev.icinga.org/issues/8156): Added the ability to use hashes directly in host `vars` parameters (instead of rendering hashes into a series of `vars.` lines in the rendered object file). * Feature: [PR-63](https://github.com/Icinga/puppet-icinga2/pull/63) and [dev.icinga.org issue #7232](https://dev.icinga.org/issues/7232): Added an Endpoint object defined type. * Feature: [PR-62](https://github.com/Icinga/puppet-icinga2/pull/62) and [dev.icinga.org issue #7230](https://dev.icinga.org/issues/7230): Added an IcingaStatusWriter object defined type. -* Feature: [PR-61](https://github.com/Icinga/puppet-icinga2/pull/61) and [dev.icinga.org issue #7229](https://dev.icinga.org/issues/7229): Added an FileLogger object defined type. +* Feature: [PR-61](https://github.com/Icinga/puppet-icinga2/pull/61) and [dev.icinga.org issue #7229](https://dev.icinga.org/issues/7229): Added a FileLogger object defined type. ###v0.6.1 (December 2nd, 2014) From ec665c146f5b5c491800d7a12857e603fdbe582a Mon Sep 17 00:00:00 2001 From: Steven Bambling Date: Thu, 18 Dec 2014 08:14:10 -0500 Subject: [PATCH 30/79] updating validation of interval to allow resending of alerts to be disabled Merged from: https://github.com/Icinga/puppet-icinga2/pull/70 refs#8153: https://dev.icinga.org/issues/8153 --- manifests/object/apply_notification_to_host.pp | 2 +- manifests/object/apply_notification_to_service.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/object/apply_notification_to_host.pp b/manifests/object/apply_notification_to_host.pp index 56dc001..8cdb17d 100644 --- a/manifests/object/apply_notification_to_host.pp +++ b/manifests/object/apply_notification_to_host.pp @@ -42,7 +42,7 @@ define icinga2::object::apply_notification_to_host ( validate_array($user_groups) validate_hash($times) if $interval { - validate_re($interval, '^\d$') + validate_string($interval) } if $period { validate_string($period) diff --git a/manifests/object/apply_notification_to_service.pp b/manifests/object/apply_notification_to_service.pp index bda9a16..b265c9f 100644 --- a/manifests/object/apply_notification_to_service.pp +++ b/manifests/object/apply_notification_to_service.pp @@ -44,7 +44,7 @@ define icinga2::object::apply_notification_to_service ( validate_array($user_groups) validate_hash($times) if $interval { - validate_re($interval, '^\d$') + validate_string($interval) } if $period { validate_string($period) From b4797124b18cb0d2fdbe9b00c313acecbeca91dc Mon Sep 17 00:00:00 2001 From: Steven Bambling Date: Thu, 18 Dec 2014 08:29:37 -0500 Subject: [PATCH 31/79] fixing typo in interval name in templates Merged from: https://github.com/Icinga/puppet-icinga2/pull/70 refs#8153: https://dev.icinga.org/issues/8153 --- templates/object_apply_notification_to_host.conf.erb | 2 +- templates/object_apply_notification_to_service.conf.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/object_apply_notification_to_host.conf.erb b/templates/object_apply_notification_to_host.conf.erb index 6fe996f..8691434 100644 --- a/templates/object_apply_notification_to_host.conf.erb +++ b/templates/object_apply_notification_to_host.conf.erb @@ -50,7 +50,7 @@ apply Notification "<%= @object_notificationname %>" to Host { } <%- end -%> <%- if @interval -%> - interval = "<%= @inteval -%>" + interval = "<%= @interval -%>" <%- end -%> <%- if @period -%> period = "<%= @period -%>" diff --git a/templates/object_apply_notification_to_service.conf.erb b/templates/object_apply_notification_to_service.conf.erb index 3549d07..dca40ee 100644 --- a/templates/object_apply_notification_to_service.conf.erb +++ b/templates/object_apply_notification_to_service.conf.erb @@ -53,7 +53,7 @@ apply Notification "<%= @object_notificationname %>" to Service { } <%- end -%> <%- if @interval -%> - interval = "<%= @inteval -%>" + interval = "<%= @interval -%>" <%- end -%> <%- if @period -%> period = "<%= @period -%>" From 2ac13ab23aad47f571a9ffe5df06d441709d3906 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sun, 4 Jan 2015 17:56:29 -0800 Subject: [PATCH 32/79] Changelog update. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b298d4a..ae159f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * Feature: [PR-63](https://github.com/Icinga/puppet-icinga2/pull/63) and [dev.icinga.org issue #7232](https://dev.icinga.org/issues/7232): Added an Endpoint object defined type. * Feature: [PR-62](https://github.com/Icinga/puppet-icinga2/pull/62) and [dev.icinga.org issue #7230](https://dev.icinga.org/issues/7230): Added an IcingaStatusWriter object defined type. * Feature: [PR-61](https://github.com/Icinga/puppet-icinga2/pull/61) and [dev.icinga.org issue #7229](https://dev.icinga.org/issues/7229): Added a FileLogger object defined type. +* Feature: [PR-70](https://github.com/Icinga/puppet-icinga2/pull/70) and [dev.icinga.org issue #8153](https://dev.icinga.org/issues/8153): Change validation of interval parameters. ###v0.6.1 (December 2nd, 2014) From 7483b6baeee524fa99e7ac9b9a502d2d0875d6a4 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sun, 4 Jan 2015 18:05:14 -0800 Subject: [PATCH 33/79] Changelog update. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae159f3..ffaf4bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Feature: [PR-62](https://github.com/Icinga/puppet-icinga2/pull/62) and [dev.icinga.org issue #7230](https://dev.icinga.org/issues/7230): Added an IcingaStatusWriter object defined type. * Feature: [PR-61](https://github.com/Icinga/puppet-icinga2/pull/61) and [dev.icinga.org issue #7229](https://dev.icinga.org/issues/7229): Added a FileLogger object defined type. * Feature: [PR-70](https://github.com/Icinga/puppet-icinga2/pull/70) and [dev.icinga.org issue #8153](https://dev.icinga.org/issues/8153): Change validation of interval parameters. +* Feature: [PR-68](https://github.com/Icinga/puppet-icinga2/pull/68) and [dev.icinga.org issue #7346](https://dev.icinga.org/issues/7346): Added OS support for Red Hat. ###v0.6.1 (December 2nd, 2014) From 579889e8ec599dbeff809e58903065191a8995cd Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sun, 4 Jan 2015 18:14:46 -0800 Subject: [PATCH 34/79] Updated metadata.json to reflect that Red Hat is supported. --- metadata.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/metadata.json b/metadata.json index 117edba..4099b72 100644 --- a/metadata.json +++ b/metadata.json @@ -22,6 +22,14 @@ "7" ] }, + { + "operatingsystem": "RedHat", + "operatingsystemmajrelease": [ + "5", + "6", + "7" + ] + }, { "operatingsystem": "Ubuntu", "operatingsystemmajrelease": [ From 9a1e40b329119a23b80c4800f9f4100808543104 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sun, 4 Jan 2015 18:15:10 -0800 Subject: [PATCH 35/79] Updated the version number in metadata.json to reflect the current version. --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 4099b72..8978884 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppet-icinga2", - "version": "0.5.0", + "version": "0.6.1", "author": "Icinga Development Team", "summary": "Icinga 2 Puppet module", "license": "GPLv2", From 877b504a6fa8564a811fd828cdc8ceabe929615c Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Mon, 5 Jan 2015 20:10:55 -0800 Subject: [PATCH 36/79] Typo. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 81051aa..2fca2a5 100644 --- a/README.md +++ b/README.md @@ -211,7 +211,7 @@ If you would like to install packages to make a `mail` command binary available **Enabling and disabling Icinga 2 features** -To manage the features that are enabled or disabled on an Icinga 2 server, you can specify them with the `server_enabled_features` and `server_enabled_features` parameters. +To manage the features that are enabled or disabled on an Icinga 2 server, you can specify them with the `server_enabled_features` and `server_disabled_features` parameters. The parameters should be given as arrays of single-quoted strings. From 32dc82e0a9f75da33bbb076a8cfa282c92812b01 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Mon, 5 Jan 2015 20:27:40 -0800 Subject: [PATCH 37/79] Added a Gemfile that has gems listed for basic Puppet unit tests. --- Gemfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Gemfile diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..182ffd4 --- /dev/null +++ b/Gemfile @@ -0,0 +1,14 @@ +source ENV['GEM_SOURCE'] || "https://rubygems.org" + +#Install the gems but don't run `require gemname` when bundler runs +#Source: http://stackoverflow.com/questions/4800721/bundler-what-does-require-false-in-a-gemfile-mean +#Source of the list of gems: https://github.com/puppetlabs/puppetlabs-ntp/blob/master/Gemfile +group :development, :unit_tests do + gem 'rake', :require => false + gem 'rspec-puppet', :require => false + gem 'puppetlabs_spec_helper', :require => false + gem 'puppet-lint', :require => false + gem 'simplecov', :require => false + gem 'puppet_facts', :require => false + gem 'json', :require => false +end \ No newline at end of file From 46f0fe7695033318eedb999a518e6cb8a5e4035c Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Mon, 5 Jan 2015 20:48:18 -0800 Subject: [PATCH 38/79] Added a .gitignore rule. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b5b7a00..4daa1fa 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ spec/fixtures/ .vagrant/ .bundle/ coverage/ +.ruby-version From 346248ad4801009d63540a82f10626ed31976096 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Mon, 5 Jan 2015 21:00:37 -0800 Subject: [PATCH 39/79] Added a Rake file with a unit_tests task that runs the lint task. --- Rakefile | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Rakefile diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..2c69ab9 --- /dev/null +++ b/Rakefile @@ -0,0 +1,3 @@ +require 'puppet-lint/tasks/puppet-lint' + +task :unit_tests => [:lint] \ No newline at end of file From 60d818fe40b0118cd0f34a3a436043cd8ad1e660 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Mon, 5 Jan 2015 21:04:08 -0800 Subject: [PATCH 40/79] Added some config options for puppet-lint. --- Rakefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 2c69ab9..1a1e2cd 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,11 @@ require 'puppet-lint/tasks/puppet-lint' -task :unit_tests => [:lint] \ No newline at end of file +task :unit_tests => [:lint] + +PuppetLint.configuration.fail_on_warnings +PuppetLint.configuration.send('relative') +PuppetLint.configuration.send('disable_80chars') +PuppetLint.configuration.send('disable_class_inherits_from_params_class') +PuppetLint.configuration.send('disable_documentation') +PuppetLint.configuration.send('disable_single_quote_string_with_variables') +PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"] \ No newline at end of file From a807ffe90a960bb0022b7e12c63031bdde1ca1b6 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Tue, 6 Jan 2015 22:44:48 -0800 Subject: [PATCH 41/79] Added an ApiListener object defined type. refs#7231 : https://dev.icinga.org/issues/7231 --- README.md | 17 +++++++ manifests/object/apilistener.pp | 73 +++++++++++++++++++++++++++ templates/object_apilistener.conf.erb | 38 ++++++++++++++ 3 files changed, 128 insertions(+) create mode 100644 manifests/object/apilistener.pp create mode 100644 templates/object_apilistener.conf.erb diff --git a/README.md b/README.md index 2fca2a5..7dd63a2 100644 --- a/README.md +++ b/README.md @@ -392,6 +392,7 @@ icinga2::object::apply_dependency { 'usermail_dep_on_icinga2mail': Object types: +* [icinga2::object::apilistener](#icinga2objectapilistener) * [icinga2::object::applyservicetohost](#icinga2objectapplyservicetohost) * [icinga2::object::applynotificationtohost](#icinga2objectapplynotificationtohost) * [icinga2::object::applynotificationtoservice](#icinga2objectapplynotificationtoservice) @@ -420,6 +421,22 @@ Object types: * [icinga2::object::user](#icinga2objectuser) * [icinga2::object::usergroup](#icinga2objectusergroup) +####[`icinga2::object::apilistener`](id:icinga2objectapilistener) + +The `apilistener` defined type can create `ApiLister` objects that set the bind address and port for Icinga 2's API listener, as well as the locations of the machine's Icinga 2 cert, key and Icinga 2 CA key: + +
+#Create an API listener object:
+icinga2::object::apilistener { 'master-api':
+  bind_host => $ipaddress_eth1,
+  accept_commands => true,
+}
+
+ +The `accept_config` and `accept_commands` parameters default to **false**. + +See the Icinga 2 documention for more info: [http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-apilistener](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-apilistener) + ####[`icinga2::object::apply_service_to_host`](id:object_apply_service_to_host) The `apply_service_to_host` defined type can create `apply` objects to apply services to hosts: diff --git a/manifests/object/apilistener.pp b/manifests/object/apilistener.pp new file mode 100644 index 0000000..cb139e1 --- /dev/null +++ b/manifests/object/apilistener.pp @@ -0,0 +1,73 @@ +# == Defined type: icinga2::object::apilistener +# +# This is a defined type for Icinga 2 apply objects that create apilistener objects. +# See the following Icinga 2 doc page for more info: +# http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-apilistener +# +# === Parameters +# +# See the inline comments. +# + +define icinga2::object::apilistener ( + $ensure = 'file', + $object_name = $name, + $cert_path = 'SysconfDir + "/icinga2/pki/" + NodeName + ".crt"', + $key_path = 'SysconfDir + "/icinga2/pki/" + NodeName + ".key"', + $ca_path = 'SysconfDir + "/icinga2/pki/ca.crt"', + $crl_path = undef, + $bind_host = '0.0.0.0', + $bind_port = 5665, + $accept_config = false, + $accept_commands = false, + $target_dir = '/etc/icinga2/objects/apilisteners', + $target_file_name = "${name}.conf", + $target_file_owner = 'root', + $target_file_group = 'root', + $target_file_mode = '0644', + $refresh_icinga2_service = true, +) { + + validate_string($cert_path) + validate_string($key_path) + validate_string($ca_path) + if $crl_path { validate_string($crl_path) } + if $bind_host { validate_string($bind_host) } + if $bind_port { validate_re($bind_port, '^\d{1,5}$') } + if $accept_config { validate_bool($accept_config) } + if $accept_commands { validate_bool($accept_commands) } + validate_string($target_dir) + validate_string($target_file_name) + validate_string($target_file_owner) + validate_string($target_file_group) + validate_re($target_file_mode, '^\d{4}$') + validate_bool($refresh_icinga2_service) + + #If the refresh_icinga2_service parameter is set to true... + if $refresh_icinga2_service == true { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_apilistener.conf.erb'), + #...notify the Icinga 2 daemon so it can restart and pick up changes made to this config file... + notify => Service['icinga2'], + } + + } + #...otherwise, use the same file resource but without a notify => parameter: + else { + + file { "${target_dir}/${target_file_name}": + ensure => $target_file_ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_apilistener.conf.erb'), + } + + } + +} diff --git a/templates/object_apilistener.conf.erb b/templates/object_apilistener.conf.erb new file mode 100644 index 0000000..fcfafee --- /dev/null +++ b/templates/object_apilistener.conf.erb @@ -0,0 +1,38 @@ +/** +* WARNING: This ApiListener object definition is automatically generated by Puppet. +* ANY MANUAL CHANGES TO IT WILL GET OVERWRITTEN! +*/ + +/** +* An ApiListener definition. You can create your own configuration files +* in the conf.d directory (e.g. one per commnand). By default all *.conf +* files in this directory are included. +* +*/ + +object ApiListener "<%= @object_name %>" { + <%- if @cert_path -%> + cert_path = <%= @cert_path %> + <%- end -%> + <%- if @key_path -%> + key_path = <%= @key_path %> + <%- end -%> + <%- if @ca_path -%> + ca_path = <%= @ca_path %> + <%- end -%> + <%- if @crl_path -%> + crl_path = <%= @crl_path %> + <%- end -%> + <%- if @bind_host -%> + bind_host = "<%= @bind_host %>" + <%- end -%> + <%- if @bind_port -%> + bind_port = <%= @bind_port %> + <%- end -%> + <%- if @accept_config -%> + accept_config = <%= @accept_config %> + <%- end -%> + <%- if @accept_commands -%> + accept_commands = <%= @accept_commands %> + <%- end -%> +} \ No newline at end of file From a89b9cd6aaa4923d4fe6bb474ac168fa35c86579 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Tue, 6 Jan 2015 22:48:04 -0800 Subject: [PATCH 42/79] Changelog update. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffaf4bf..ae172ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ * Feature: [PR-61](https://github.com/Icinga/puppet-icinga2/pull/61) and [dev.icinga.org issue #7229](https://dev.icinga.org/issues/7229): Added a FileLogger object defined type. * Feature: [PR-70](https://github.com/Icinga/puppet-icinga2/pull/70) and [dev.icinga.org issue #8153](https://dev.icinga.org/issues/8153): Change validation of interval parameters. * Feature: [PR-68](https://github.com/Icinga/puppet-icinga2/pull/68) and [dev.icinga.org issue #7346](https://dev.icinga.org/issues/7346): Added OS support for Red Hat. +* Feature: [dev.icinga.org issue #7231](https://dev.icinga.org/issues/7231): Added an `ApiListener` object defined type. ###v0.6.1 (December 2nd, 2014) From b49fd7e09e1f03d6c6816ca205ad40fcf8518188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Achim=20Lederm=C3=BCller?= Date: Thu, 8 Jan 2015 13:18:14 +0100 Subject: [PATCH 43/79] Fixed typo in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 779a381..1adffd8 100644 --- a/README.md +++ b/README.md @@ -173,7 +173,7 @@ If you would like to use the [Debmon repository](http://debmon.org/packages) for class { 'icinga2::server': server_db_type => 'pgsql', # default to false - use_debmon => true, + use_debmon_repo => true, db_host => 'localhost' db_port => '5432' db_name => 'icinga2_data' From 73c91649e0ed5d79663203e8a83c22645f0974ea Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sat, 10 Jan 2015 16:51:38 -0800 Subject: [PATCH 44/79] Add a target_file_ensure parameter to the ApiListener object defined type. --- manifests/object/apilistener.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/object/apilistener.pp b/manifests/object/apilistener.pp index cb139e1..e835179 100644 --- a/manifests/object/apilistener.pp +++ b/manifests/object/apilistener.pp @@ -22,6 +22,7 @@ define icinga2::object::apilistener ( $accept_commands = false, $target_dir = '/etc/icinga2/objects/apilisteners', $target_file_name = "${name}.conf", + $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', $target_file_mode = '0644', From ec23b00b12811234b80eb42c042e0ad9cb804c47 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sat, 10 Jan 2015 16:59:17 -0800 Subject: [PATCH 45/79] Added a full variable scope. --- manifests/nrpe/install.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/nrpe/install.pp b/manifests/nrpe/install.pp index 5af3db6..c3350ce 100644 --- a/manifests/nrpe/install.pp +++ b/manifests/nrpe/install.pp @@ -34,7 +34,7 @@ class icinga2::nrpe::install::packages inherits icinga2::nrpe { package {$icinga2::params::icinga2_client_packages: ensure => installed, provider => $icinga2::params::package_provider, - install_options => $client_plugin_package_install_options, + install_options => $icinga2::params::client_plugin_package_install_options, } } From 09d6a8c9d2af8800b00c4988b43f0b8ce525408b Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sat, 10 Jan 2015 17:04:43 -0800 Subject: [PATCH 46/79] Fix C/C++ style comments so they use # instead. --- manifests/object/checkcommand.pp | 2 +- manifests/object/eventcommand.pp | 2 +- manifests/object/notification.pp | 18 ++++++++---------- manifests/object/notificationcommand.pp | 2 +- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/manifests/object/checkcommand.pp b/manifests/object/checkcommand.pp index bf5ea50..510dbbc 100644 --- a/manifests/object/checkcommand.pp +++ b/manifests/object/checkcommand.pp @@ -12,7 +12,7 @@ define icinga2::object::checkcommand ( $object_checkcommandname = $name, $template_to_import = 'plugin-check-command', -/* $methods = undef, */ /* Need to get more details about this attribute */ + #$methods = undef, Need to get more details about this attribute $command = undef, $cmd_path = 'PluginDir', $arguments = {}, diff --git a/manifests/object/eventcommand.pp b/manifests/object/eventcommand.pp index 96dd3f0..e0a3095 100644 --- a/manifests/object/eventcommand.pp +++ b/manifests/object/eventcommand.pp @@ -12,7 +12,7 @@ define icinga2::object::eventcommand ( $object_eventcommandname = $name, $template_to_import = 'plugin-event-command', -/* $methods = undef, */ /* Need to get more details about this attribute */ + #$methods = undef Need to get more details about this attribute $command = undef, $cmd_path = 'PluginDir', $arguments = {}, diff --git a/manifests/object/notification.pp b/manifests/object/notification.pp index e8d5b4e..fb294f7 100644 --- a/manifests/object/notification.pp +++ b/manifests/object/notification.pp @@ -51,17 +51,15 @@ define icinga2::object::notification ( validate_string($period) } validate_array($types) -/** Array concatenation not available, - if $types - ['DowntimeStart','DowntimeEnd','DowntimeRemoved','Custom','Acknowledgement','Problem','Recovery','FlappingStart','FlappingEnd'] != [] { - fail ('You are using unavailable notification type filter.') - } -*/ + #Array concatenation not available, + #if $types - ['DowntimeStart','DowntimeEnd','DowntimeRemoved','Custom','Acknowledgement','Problem','Recovery','FlappingStart','FlappingEnd'] != [] { + # fail ('You are using unavailable notification type filter.') + #} validate_array($states) -/** Array concatenation not available, - if $states - ['OK','Warning','Critical','Unknown','Up','Down'] != [] { - fail ('You are using unavailable state type filter.') - } -*/ + #Array concatenation not available, + #if $states - ['OK','Warning','Critical','Unknown','Up','Down'] != [] { + # fail ('You are using unavailable state type filter.') + #} validate_string($target_dir) validate_string($target_file_name) validate_string($target_file_owner) diff --git a/manifests/object/notificationcommand.pp b/manifests/object/notificationcommand.pp index d909c47..4419614 100644 --- a/manifests/object/notificationcommand.pp +++ b/manifests/object/notificationcommand.pp @@ -12,7 +12,7 @@ define icinga2::object::notificationcommand ( $object_notificationcommandname = $name, $template_to_import = 'plugin-notification-command', -/* $methods = undef, */ /* Need to get more details about this attribute */ + #$methods = undef, Need to get more details about this attribute $command = undef, $cmd_path = 'PluginDir', $arguments = {}, From 700c24261ee558d6811367509ea4bf1d8be1e76f Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sat, 10 Jan 2015 17:05:34 -0800 Subject: [PATCH 47/79] Use 2 spaces instead of a tab character. --- manifests/object/servicegroup.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/object/servicegroup.pp b/manifests/object/servicegroup.pp index 2650fed..4afe648 100644 --- a/manifests/object/servicegroup.pp +++ b/manifests/object/servicegroup.pp @@ -16,7 +16,7 @@ define icinga2::object::servicegroup ( $groups = [], $target_dir = '/etc/icinga2/objects', $target_file_name = "${name}.conf", - $target_file_ensure = file, + $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', $target_file_mode = '0644', From a2a1ec11e07f36179d37694ac1bc2398413247c5 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sat, 10 Jan 2015 17:06:01 -0800 Subject: [PATCH 48/79] Removed a trailing space. --- manifests/object/user.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/object/user.pp b/manifests/object/user.pp index 21ea6d7..36338ca 100644 --- a/manifests/object/user.pp +++ b/manifests/object/user.pp @@ -22,7 +22,7 @@ define icinga2::object::user ( $states = [], $target_dir = '/etc/icinga2/objects', $target_file_name = "${name}.conf", - $target_file_ensure = file, + $target_file_ensure = file, $target_file_owner = 'root', $target_file_group = 'root', $target_file_mode = '0644', From 2a3a2c5d0fe3fafc96ce2ffdaff2601d914ef347 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sat, 10 Jan 2015 17:12:57 -0800 Subject: [PATCH 49/79] Removed trailing whitespace. --- manifests/object/apilistener.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/object/apilistener.pp b/manifests/object/apilistener.pp index e835179..d7e85c4 100644 --- a/manifests/object/apilistener.pp +++ b/manifests/object/apilistener.pp @@ -19,7 +19,7 @@ define icinga2::object::apilistener ( $bind_host = '0.0.0.0', $bind_port = 5665, $accept_config = false, - $accept_commands = false, + $accept_commands = false, $target_dir = '/etc/icinga2/objects/apilisteners', $target_file_name = "${name}.conf", $target_file_ensure = file, From 8a8bf2440063b0a1af56cb8d13ca02adab6045a8 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sat, 10 Jan 2015 17:34:45 -0800 Subject: [PATCH 50/79] Fixed whitespace alignment in the icinga2::server::config class. --- manifests/server/config.pp | 402 ++++++++++++++++++------------------- 1 file changed, 201 insertions(+), 201 deletions(-) diff --git a/manifests/server/config.pp b/manifests/server/config.pp index ee46770..2176341 100644 --- a/manifests/server/config.pp +++ b/manifests/server/config.pp @@ -29,18 +29,18 @@ class icinga2::server::config inherits icinga2::server { #Directory resource for /etc/icinga2/: file { '/etc/icinga2/': - ensure => directory, - path => '/etc/icinga2/', - owner => $etc_icinga2_owner, - group => $etc_icinga2_group, - mode => $etc_icinga2_mode, + ensure => directory, + path => '/etc/icinga2/', + owner => $etc_icinga2_owner, + group => $etc_icinga2_group, + mode => $etc_icinga2_mode, #require => Package[$icinga2::params::icinga2_server_packages], } #File resource for /etc/icinga2/icinga2.conf: file { '/etc/icinga2/icinga2.conf': ensure => file, - path => '/etc/icinga2/icinga2.conf', + path => '/etc/icinga2/icinga2.conf', owner => $etc_icinga2_icinga2_conf_owner, group => $etc_icinga2_icinga2_conf_group, mode => $etc_icinga2_icinga2_conf_mode, @@ -49,56 +49,56 @@ class icinga2::server::config inherits icinga2::server { #Directory resource for /etc/icinga2/conf.d/: file { '/etc/icinga2/conf.d/': - ensure => directory, - path => '/etc/icinga2/conf.d/', - owner => $etc_icinga2_confd_owner, - group => $etc_icinga2_confd_group, - mode => $etc_icinga2_confd_mode, + ensure => directory, + path => '/etc/icinga2/conf.d/', + owner => $etc_icinga2_confd_owner, + group => $etc_icinga2_confd_group, + mode => $etc_icinga2_confd_mode, } #Directory resource for /etc/icinga2/features-available/: file { '/etc/icinga2/features-available/': - ensure => directory, - path => '/etc/icinga2/features-available/', - owner => $etc_icinga2_features_available_owner, - group => $etc_icinga2_features_available_group, - mode => $etc_icinga2_features_available_mode, + ensure => directory, + path => '/etc/icinga2/features-available/', + owner => $etc_icinga2_features_available_owner, + group => $etc_icinga2_features_available_group, + mode => $etc_icinga2_features_available_mode, } #Directory resource for /etc/icinga2/features-enabled/: file { '/etc/icinga2/features-enabled/': - ensure => directory, - path => '/etc/icinga2/features-enabled/', - owner => $etc_icinga2_features_enabled_owner, - group => $etc_icinga2_features_enabled_group, - mode => $etc_icinga2_features_enabled_mode, + ensure => directory, + path => '/etc/icinga2/features-enabled/', + owner => $etc_icinga2_features_enabled_owner, + group => $etc_icinga2_features_enabled_group, + mode => $etc_icinga2_features_enabled_mode, } #Directory resource for /etc/icinga2/pki/: file { '/etc/icinga2/pki/': - ensure => directory, - path => '/etc/icinga2/pki/', - owner => $etc_icinga2_pki_owner, - group => $etc_icinga2_pki_group, - mode => $etc_icinga2_pki_mode, + ensure => directory, + path => '/etc/icinga2/pki/', + owner => $etc_icinga2_pki_owner, + group => $etc_icinga2_pki_group, + mode => $etc_icinga2_pki_mode, } #Directory resource for /etc/icinga2/scripts/: file { '/etc/icinga2/scripts/': - ensure => directory, - path => '/etc/icinga2/scripts/', - owner => $etc_icinga2_scripts_owner, - group => $etc_icinga2_scripts_group, - mode => $etc_icinga2_scripts_mode, + ensure => directory, + path => '/etc/icinga2/scripts/', + owner => $etc_icinga2_scripts_owner, + group => $etc_icinga2_scripts_group, + mode => $etc_icinga2_scripts_mode, } #Directory resource for /etc/icinga2/zones.d/: file { '/etc/icinga2/zones.d/': - ensure => directory, - path => '/etc/icinga2/zones.d/', - owner => $etc_icinga2_zonesd_owner, - group => $etc_icinga2_zonesd_group, - mode => $etc_icinga2_zonesd_mode, + ensure => directory, + path => '/etc/icinga2/zones.d/', + owner => $etc_icinga2_zonesd_owner, + group => $etc_icinga2_zonesd_group, + mode => $etc_icinga2_zonesd_mode, } #File and directory resources for the object directories that can be used to hold different @@ -118,272 +118,272 @@ class icinga2::server::config inherits icinga2::server { #Directory resource for /etc/icinga2/objects/hosts/: file { '/etc/icinga2/objects/hosts/': - ensure => directory, - path => '/etc/icinga2/objects/hosts/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/hosts/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/hostgroups/: file { '/etc/icinga2/objects/hostgroups/': - ensure => directory, - path => '/etc/icinga2/objects/hostgroups/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/hostgroups/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/services/: file { '/etc/icinga2/objects/services/': - ensure => directory, - path => '/etc/icinga2/objects/services/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/services/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/servicegroups/: file { '/etc/icinga2/objects/servicegroups/': - ensure => directory, - path => '/etc/icinga2/objects/servicegroups/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/servicegroups/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/users/: file { '/etc/icinga2/objects/users/': - ensure => directory, - path => '/etc/icinga2/objects/users/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/users/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/usergroups/: file { '/etc/icinga2/objects/usergroups/': - ensure => directory, - path => '/etc/icinga2/objects/usergroups/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/usergroups/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/checkcommands/: file { '/etc/icinga2/objects/checkcommands/': - ensure => directory, - path => '/etc/icinga2/objects/checkcommands/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/checkcommands/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/notificationcommands/: file { '/etc/icinga2/objects/notificationcommands/': - ensure => directory, - path => '/etc/icinga2/objects/notificationcommands/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/notificationcommands/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/eventcommands/: file { '/etc/icinga2/objects/eventcommands/': - ensure => directory, - path => '/etc/icinga2/objects/eventcommands/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/eventcommands/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/notifications/: file { '/etc/icinga2/objects/notifications/': - ensure => directory, - path => '/etc/icinga2/objects/notifications/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/notifications/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/timeperiods/: file { '/etc/icinga2/objects/timeperiods/': - ensure => directory, - path => '/etc/icinga2/objects/timeperiods/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/timeperiods/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/scheduleddowntimes/: file { '/etc/icinga2/objects/scheduleddowntimes/': - ensure => directory, - path => '/etc/icinga2/objects/scheduleddowntimes/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/scheduleddowntimes/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/dependencies/: file { '/etc/icinga2/objects/dependencies/': - ensure => directory, - path => '/etc/icinga2/objects/dependencies/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/dependencies/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/perfdatawriters/: file { '/etc/icinga2/objects/perfdatawriters/': - ensure => directory, - path => '/etc/icinga2/objects/perfdatawriters/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/perfdatawriters/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/graphitewriters/: file { '/etc/icinga2/objects/graphitewriters/': - ensure => directory, - path => '/etc/icinga2/objects/graphitewriters/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/graphitewriters/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/idomysqlconnections/: file { '/etc/icinga2/objects/idomysqlconnections/': - ensure => directory, - path => '/etc/icinga2/objects/idomysqlconnections/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/idomysqlconnections/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/idopgsqlconnections/: file { '/etc/icinga2/objects/idopgsqlconnections/': - ensure => directory, - path => '/etc/icinga2/objects/idopgsqlconnections/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/idopgsqlconnections/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/livestatuslisteners/: file { '/etc/icinga2/objects/livestatuslisteners/': - ensure => directory, - path => '/etc/icinga2/objects/livestatuslisteners/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/livestatuslisteners/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/statusdatawriters/: file { '/etc/icinga2/objects/statusdatawriters/': - ensure => directory, - path => '/etc/icinga2/objects/statusdatawriters/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/statusdatawriters/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/externalcommandlisteners/: file { '/etc/icinga2/objects/externalcommandlisteners/': - ensure => directory, - path => '/etc/icinga2/objects/externalcommandlisteners/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/externalcommandlisteners/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/compatloggers/: file { '/etc/icinga2/objects/compatloggers/': - ensure => directory, - path => '/etc/icinga2/objects/compatloggers/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/compatloggers/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/checkresultreaders/: file { '/etc/icinga2/objects/checkresultreaders/': - ensure => directory, - path => '/etc/icinga2/objects/checkresultreaders/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/checkresultreaders/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/checkercomponents/: file { '/etc/icinga2/objects/checkercomponents/': - ensure => directory, - path => '/etc/icinga2/objects/checkercomponents/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/checkercomponents/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/notificationcomponents/: file { '/etc/icinga2/objects/notificationcomponents/': - ensure => directory, - path => '/etc/icinga2/objects/notificationcomponents/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/notificationcomponents/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/fileloggers/: file { '/etc/icinga2/objects/fileloggers/': - ensure => directory, - path => '/etc/icinga2/objects/fileloggers/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/fileloggers/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/syslogloggers/: file { '/etc/icinga2/objects/syslogloggers/': - ensure => directory, - path => '/etc/icinga2/objects/syslogloggers/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/syslogloggers/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/icingastatuswriters/: file { '/etc/icinga2/objects/icingastatuswriters/': - ensure => directory, - path => '/etc/icinga2/objects/icingastatuswriters/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/icingastatuswriters/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/apilisteners/: file { '/etc/icinga2/objects/apilisteners/': - ensure => directory, - path => '/etc/icinga2/objects/apilisteners/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/apilisteners/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/endpoints/: file { '/etc/icinga2/objects/endpoints/': - ensure => directory, - path => '/etc/icinga2/objects/endpoints/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/endpoints/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/zones/: file { '/etc/icinga2/objects/zones/': - ensure => directory, - path => '/etc/icinga2/objects/zones/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/zones/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/applys/ @@ -392,30 +392,30 @@ class icinga2::server::config inherits icinga2::server { #See the following link for more info: # http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc#!/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#apply file { '/etc/icinga2/objects/applys/': - ensure => directory, - path => '/etc/icinga2/objects/applys/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/applys/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/templates/: file { '/etc/icinga2/objects/templates/': - ensure => directory, - path => '/etc/icinga2/objects/templates/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/templates/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } #Directory resource for /etc/icinga2/objects/constants/: file { '/etc/icinga2/objects/constants/': - ensure => directory, - path => '/etc/icinga2/objects/constants/', - owner => $etc_icinga2_obejcts_sub_dir_owner, - group => $etc_icinga2_obejcts_sub_dir_group, - mode => $etc_icinga2_obejcts_sub_dir_mode, + ensure => directory, + path => '/etc/icinga2/objects/constants/', + owner => $etc_icinga2_obejcts_sub_dir_owner, + group => $etc_icinga2_obejcts_sub_dir_group, + mode => $etc_icinga2_obejcts_sub_dir_mode, } } From 98c598ce167164857a3e79b0ede9d4eae88cde84 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sat, 10 Jan 2015 17:35:06 -0800 Subject: [PATCH 51/79] Fixed whitespace alignment in the icinga2::server::install class. --- manifests/server/install.pp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manifests/server/install.pp b/manifests/server/install.pp index 5bba9bf..851926b 100644 --- a/manifests/server/install.pp +++ b/manifests/server/install.pp @@ -96,8 +96,8 @@ class icinga2::server::install::packages inherits icinga2::server { if $server_install_nagios_plugins == true { #Install the Nagios plugins packages: package {$icinga2_server_plugin_packages: - ensure => installed, - provider => $package_provider, + ensure => installed, + provider => $package_provider, install_options => $server_plugin_package_install_options, } } @@ -105,8 +105,8 @@ class icinga2::server::install::packages inherits icinga2::server { if $install_mail_utils_package == true { #Install the package that has the 'mail' binary in it so we can send notifications: package {$icinga2_server_mail_package: - ensure => installed, - provider => $package_provider, + ensure => installed, + provider => $package_provider, install_options => $server_plugin_package_install_options, } } From 8e8de1778eb4fcf5bdbe90e7f2ed7336bbedfce2 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sat, 10 Jan 2015 17:35:58 -0800 Subject: [PATCH 52/79] Disable puppet-lint variable scope checks. --- Rakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Rakefile b/Rakefile index 1a1e2cd..9101a01 100644 --- a/Rakefile +++ b/Rakefile @@ -8,4 +8,5 @@ PuppetLint.configuration.send('disable_80chars') PuppetLint.configuration.send('disable_class_inherits_from_params_class') PuppetLint.configuration.send('disable_documentation') PuppetLint.configuration.send('disable_single_quote_string_with_variables') +PuppetLint.configuration.send('disable_variable_scope') PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"] \ No newline at end of file From f23815571f2f2f9ebf96caec76677a281a13f8fc Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sat, 10 Jan 2015 17:36:48 -0800 Subject: [PATCH 53/79] Disable puppet-lint class autoloader layout checks. --- Rakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Rakefile b/Rakefile index 9101a01..fa92182 100644 --- a/Rakefile +++ b/Rakefile @@ -9,4 +9,5 @@ PuppetLint.configuration.send('disable_class_inherits_from_params_class') PuppetLint.configuration.send('disable_documentation') PuppetLint.configuration.send('disable_single_quote_string_with_variables') PuppetLint.configuration.send('disable_variable_scope') +PuppetLint.configuration.send('disable_autoloader_layout') PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"] \ No newline at end of file From 8adf30ebd67584634286e11cf89b4a87e529563b Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Mon, 5 Jan 2015 13:32:24 +0100 Subject: [PATCH 54/79] Ignore VIM swap files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 4daa1fa..968f9f2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.*.swp +.*.swo pkg/ Gemfile.lock vendor/ From a733b4cd1cda7f78d398bb46eed5cfaf7b20544f Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Mon, 5 Jan 2015 13:38:48 +0100 Subject: [PATCH 55/79] Update mailmap and AUTHORS --- .mailmap | 3 +++ AUTHORS | 20 +++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.mailmap b/.mailmap index 2cb069d..b2c6703 100644 --- a/.mailmap +++ b/.mailmap @@ -3,3 +3,6 @@ Nick Chappell nickchappell Mélanie Gault melanie +Mélanie Gault Melanie Gault +Ricardo Cropalato de Melo ricardo@cropalato.com.br +Olivier Fontannaud ofontannaud diff --git a/AUTHORS b/AUTHORS index 9741758..61d5c55 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,11 +1,21 @@ +Achim Ledermüller Adam Stephens +Alessandro Franceschi +Alexandre Beche +Devon Mizelle Gunnar Beutner +Josh Holland +Markus Frosch +Matthew Brooks +Matthew J. Brooks Mélanie Gault Michael Friedrich Nick Chappell -Thomas Weißschuh -Steven Bambling -Josh Holland +Nicolas Bigler +Olivier Fontannaud +Olivier FONTANNAUD +Ricardo Cropalato de Melo Ricardo Melo -Tom De Vylder -Devon Mizelle \ No newline at end of file +Steven Bambling +Thomas Weißschuh +Tom De Vylder From efddfd154033e002a70720a1bb3ce62842ab01fd Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Tue, 13 Jan 2015 13:02:15 +0100 Subject: [PATCH 56/79] Update Redmine URL to project --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 8978884..676dd43 100644 --- a/metadata.json +++ b/metadata.json @@ -6,7 +6,7 @@ "license": "GPLv2", "source": "git://github.com/icinga/puppet-icinga2", "project_page": "https://github.com/icinga/puppet-icinga2", - "issues_url": "https://dev.icinga.org/projects/icinga-tools", + "issues_url": "https://dev.icinga.org/projects/puppet-icinga2", "operatingsystem_support": [ { "operatingsystem": "CentOS", From 4fc9c9831c1b6696fdffe9b433c9d9c22a813fc2 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Tue, 13 Jan 2015 13:04:21 +0100 Subject: [PATCH 57/79] De-duplicate AUTHORS --- .mailmap | 3 +++ AUTHORS | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.mailmap b/.mailmap index b2c6703..247cdb9 100644 --- a/.mailmap +++ b/.mailmap @@ -5,4 +5,7 @@ Nick Chappell nickchappell Mélanie Gault melanie Mélanie Gault Melanie Gault Ricardo Cropalato de Melo ricardo@cropalato.com.br +Ricardo Cropalato de Melo Ricardo Melo Olivier Fontannaud ofontannaud +Olivier Fontannaud Olivier FONTANNAUD +Matthew J. Brooks Matthew Brooks diff --git a/AUTHORS b/AUTHORS index 61d5c55..1460575 100644 --- a/AUTHORS +++ b/AUTHORS @@ -6,16 +6,13 @@ Devon Mizelle Gunnar Beutner Josh Holland Markus Frosch -Matthew Brooks Matthew J. Brooks Mélanie Gault Michael Friedrich Nick Chappell Nicolas Bigler Olivier Fontannaud -Olivier FONTANNAUD Ricardo Cropalato de Melo -Ricardo Melo Steven Bambling Thomas Weißschuh Tom De Vylder From ee008782f768325324edd4d417c083f01df03f5f Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Tue, 13 Jan 2015 13:05:30 +0100 Subject: [PATCH 58/79] Remove classes that are empty We do not need them, there are just a distraction... Refs #8197 --- manifests/init.pp | 18 ------------------ manifests/object.pp | 13 ------------- 2 files changed, 31 deletions(-) delete mode 100644 manifests/init.pp delete mode 100644 manifests/object.pp diff --git a/manifests/init.pp b/manifests/init.pp deleted file mode 100644 index b8b7f79..0000000 --- a/manifests/init.pp +++ /dev/null @@ -1,18 +0,0 @@ -# == Class: icinga2 -# -# This module installs the Icinga 2 monitoring system. -# -# === Parameters -# -# Coming soon... -# -# === Examples -# -# Coming soon... -# - -#Our base class. - -class icinga2 { - -} diff --git a/manifests/object.pp b/manifests/object.pp deleted file mode 100644 index b5abc92..0000000 --- a/manifests/object.pp +++ /dev/null @@ -1,13 +0,0 @@ -# == Class: icinga2::params -# -# This class is intentionally empty. It just serves as a container class for other -# icinga2::object:: classes to make the module's file layout cleaner (all object defined types -# can be put into an objects/ subdirectory) -# -# === Parameters -# -# None. See inline comments for parameters on the individual object type manifests for -# more details. -# - -class icinga2::objects { } From 34725fba7ea186c66ae27cac6523d70c1949da8d Mon Sep 17 00:00:00 2001 From: Tom De Vylder Date: Tue, 13 Jan 2015 13:32:37 +0100 Subject: [PATCH 59/79] Fix default host object address for systemd's predictable interfaces --- manifests/object/host.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/object/host.pp b/manifests/object/host.pp index 9937582..3492d35 100644 --- a/manifests/object/host.pp +++ b/manifests/object/host.pp @@ -12,7 +12,7 @@ define icinga2::object::host ( $object_hostname = $name, $display_name = $fqdn, - $ipv4_address = $ipaddress_eth0, + $ipv4_address = $ipaddress, $ipv6_address = undef, $template_to_import = 'generic-host', $groups = [], From 05f479d4f875386d553eb1fffee0464454330149 Mon Sep 17 00:00:00 2001 From: Alexandre Beche Date: Tue, 13 Jan 2015 16:35:31 +0100 Subject: [PATCH 60/79] Fixing hash ordering in erb templates Signed-off-by: Alexandre Beche --- templates/object_apply_notification_to_host.conf.erb | 6 +++--- templates/object_apply_notification_to_service.conf.erb | 6 +++--- templates/object_apply_service_to_host.conf.erb | 2 +- templates/object_checkcommand.conf.erb | 8 ++++---- templates/object_eventcommand.conf.erb | 8 ++++---- templates/object_host.conf.erb | 4 ++-- templates/object_idomysqlconnection.conf.erb | 4 ++-- templates/object_idopgsqlconnection.conf.erb | 4 ++-- templates/object_notification.conf.erb | 6 +++--- templates/object_notificationcommand.conf.erb | 8 ++++---- templates/object_scheduleddowntime.conf.erb | 2 +- templates/object_service.conf.erb | 2 +- templates/object_timeperiod.conf.erb | 2 +- templates/object_user.conf.erb | 4 ++-- 14 files changed, 33 insertions(+), 33 deletions(-) diff --git a/templates/object_apply_notification_to_host.conf.erb b/templates/object_apply_notification_to_host.conf.erb index 8691434..31a30c2 100644 --- a/templates/object_apply_notification_to_host.conf.erb +++ b/templates/object_apply_notification_to_host.conf.erb @@ -26,10 +26,10 @@ apply Notification "<%= @object_notificationname %>" to Host { command = "<%= @command %>" <%- end -%> <%- if @vars.empty? != true -%> - <%- @vars.each_pair do |key,value| -%> + <%- @vars.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <% if value.class == String %><%= value %> <%- else -%>{ - <%- value.each_pair do |k,v| -%> + <%- value.sort_by {|k, v| k}.each do |k, v| -%> <%= k %> = <%= v %> <%- end -%> } @@ -44,7 +44,7 @@ apply Notification "<%= @object_notificationname %>" to Host { <%- end -%> <%- if @times.empty? != true -%> times = { - <%- @times.each_pair do |key,value| -%> + <%- @times.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = "<%= value %>" <%- end -%> } diff --git a/templates/object_apply_notification_to_service.conf.erb b/templates/object_apply_notification_to_service.conf.erb index dca40ee..446f9ff 100644 --- a/templates/object_apply_notification_to_service.conf.erb +++ b/templates/object_apply_notification_to_service.conf.erb @@ -29,10 +29,10 @@ apply Notification "<%= @object_notificationname %>" to Service { command = "<%= @command %>" <%- end -%> <%- if @vars.empty? != true -%> - <%- @vars.each_pair do |key,value| -%> + <%- @vars.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <% if value.class == String %><%= value %> <%- else -%>{ - <%- value.each_pair do |k,v| -%> + <%- value.sort_by {|k, v| k}.each do |k, v| -%> <%= k %> = <%= v %> <%- end -%> } @@ -47,7 +47,7 @@ apply Notification "<%= @object_notificationname %>" to Service { <%- end -%> <%- if @times.empty? != true -%> times = { - <%- @times.each_pair do |key,value| -%> + <%- @times.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = "<%= value %>" <%- end -%> } diff --git a/templates/object_apply_service_to_host.conf.erb b/templates/object_apply_service_to_host.conf.erb index 867798c..e380810 100644 --- a/templates/object_apply_service_to_host.conf.erb +++ b/templates/object_apply_service_to_host.conf.erb @@ -35,7 +35,7 @@ apply Service "<%= @object_servicename %>" to Host { check_command = "<%= @check_command -%>" <%- end -%> <%- if @vars.empty? != true -%> - <%- @vars.each_pair do |key, value| -%> + <%- @vars.sort_by {|key, value| key}.each do |key, value| -%> vars.<%= key %> = "<%= value %>" <%- end -%> <%- end -%> diff --git a/templates/object_checkcommand.conf.erb b/templates/object_checkcommand.conf.erb index 666d3bb..e05a563 100644 --- a/templates/object_checkcommand.conf.erb +++ b/templates/object_checkcommand.conf.erb @@ -27,7 +27,7 @@ object CheckCommand "<%= @object_checkcommandname %>" { <%- @arguments.each_with_index do |(key,value), i| -%> <%= key %> = <% if value.class == String %><%= value %> <%- else -%>{ - <%- value.each_pair do |k,v| -%> + <%- value.sort_by {|k, v| k}.each do |k, v| -%> <%= k %> = <%= v %> <%- end -%> } @@ -37,10 +37,10 @@ object CheckCommand "<%= @object_checkcommandname %>" { <%- end -%> <%- if @vars -%> - <%- @vars.each_pair do |key,value| -%> + <%- @vars.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <% if value.class == String %><%= value %> <%- else -%>{ - <%- value.each_pair do |k,v| -%> + <%- value.sort_by {|k, v| k}.each do |k, v| -%> <%= k %> = <%= v %> <%- end -%> } @@ -54,7 +54,7 @@ object CheckCommand "<%= @object_checkcommandname %>" { <%- if @env -%> env = { - <%- @vars.each_pair do |key,value| -%> + <%- @vars.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <%= value %> <%- end -%> } diff --git a/templates/object_eventcommand.conf.erb b/templates/object_eventcommand.conf.erb index 79459a8..72763c6 100644 --- a/templates/object_eventcommand.conf.erb +++ b/templates/object_eventcommand.conf.erb @@ -27,7 +27,7 @@ object EventCommand "<%= @object_eventcommandname %>" { <%- @arguments.each_with_index do |(key,value), i| -%> <%= key %> = <% if value.class == String %><%= value %> <%- else -%>{ - <%- value.each_pair do |k,v| -%> + <%- value.sort_by {|k, v| k}.each do |k, v| -%> <%= k %> = <%= v %> <%- end -%> } @@ -37,10 +37,10 @@ object EventCommand "<%= @object_eventcommandname %>" { <%- end -%> <%- if @vars.empty? -%> - <%- @vars.each_pair do |key,value| -%> + <%- @vars.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <% if value.class == String %><%= value %> <%- else -%>{ - <%- value.each_pair do |k,v| -%> + <%- value.sort_by {|k, v| k}.each do |k, v| -%> <%= k %> = <%= v %> <%- end -%> } @@ -54,7 +54,7 @@ object EventCommand "<%= @object_eventcommandname %>" { <%- if @env.empty? != true -%> env = { - <%- @env.each_pair do |key,value| -%> + <%- @env.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <%= value %> <%- end -%> } diff --git a/templates/object_host.conf.erb b/templates/object_host.conf.erb index 3a779c7..c4223fc 100644 --- a/templates/object_host.conf.erb +++ b/templates/object_host.conf.erb @@ -29,10 +29,10 @@ object Host "<%= @object_hostname %>" { groups = [ <%- @groups.each do |group| -%> "<%= group %>", <%- end -%>] <%- end -%> <%- if @vars.empty? != true -%> - <%- @vars.each_pair do |key, value| -%> + <%- @vars.sort_by {|key, value| key}.each do |key, value| -%> <%- if value.is_a?(Hash) -%> vars.<%= key %> = { - <%- value.each_pair do |subkey,subvalue|-%> + <%- value.sort_by {|subkey,subvalue| subkey}.each do |subkey,subvalue| -%> <%= subkey %> = <%= subvalue %> <%- end -%> } diff --git a/templates/object_idomysqlconnection.conf.erb b/templates/object_idomysqlconnection.conf.erb index cb83b87..c59feb0 100644 --- a/templates/object_idomysqlconnection.conf.erb +++ b/templates/object_idomysqlconnection.conf.erb @@ -45,7 +45,7 @@ object IdoMysqlConnection "mysql-ido" { <%- if @cleanup.empty? != true -%> cleanup = { - <%- @cleanup.each_pair do |key, value| -%> + <%- @cleanup.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <%= value %> <%- end -%> } @@ -54,4 +54,4 @@ object IdoMysqlConnection "mysql-ido" { <%- if @categories.length != 0 -%> categories = <%= @categories.map {|category| "#{category}"}.join(' | ') %> <%- end -%> -} \ No newline at end of file +} diff --git a/templates/object_idopgsqlconnection.conf.erb b/templates/object_idopgsqlconnection.conf.erb index ae91842..6f4c8fc 100644 --- a/templates/object_idopgsqlconnection.conf.erb +++ b/templates/object_idopgsqlconnection.conf.erb @@ -45,7 +45,7 @@ object IdoPgsqlConnection "pgsql-ido" { <%- if @cleanup.empty? != true -%> cleanup = { - <%- @cleanup.each_pair do |key, value| -%> + <%- @cleanup.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <%= value %> <%- end -%> } @@ -54,4 +54,4 @@ object IdoPgsqlConnection "pgsql-ido" { <%- if @categories.length != 0 -%> categories = <%= @categories.map {|category| "#{category}"}.join(' | ') %> <%- end -%> -} \ No newline at end of file +} diff --git a/templates/object_notification.conf.erb b/templates/object_notification.conf.erb index ee78d2f..4ec5931 100644 --- a/templates/object_notification.conf.erb +++ b/templates/object_notification.conf.erb @@ -26,10 +26,10 @@ object Notification "<%= @object_notificationname %>" { <%- end -%> <%- if @vars.empty? != true -%> - <%- @vars.each_pair do |key,value| -%> + <%- @vars.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <% if value.class == String %><%= value %> <%- else -%>{ - <%- value.each_pair do |k,v| -%> + <%- value.sort_by {|k, v| k}.each do |k, v| -%> <%= k %> = <%= v %> <%- end -%> } @@ -47,7 +47,7 @@ object Notification "<%= @object_notificationname %>" { <%- if @times.empty? != true -%> times = { - <%- @times.each_pair do |key,value| -%> + <%- @times.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <%= value %> <%- end -%> } diff --git a/templates/object_notificationcommand.conf.erb b/templates/object_notificationcommand.conf.erb index 73fc8af..3c8e969 100644 --- a/templates/object_notificationcommand.conf.erb +++ b/templates/object_notificationcommand.conf.erb @@ -27,7 +27,7 @@ object NotificationCommand "<%= @object_notificationcommandname %>" { <%- @arguments.each_with_index do |(key,value), i| -%> <%= key %> = <% if value.class == String %><%= value %> <%- else -%>{ - <%- value.each_pair do |k,v| -%> + <%- value.sort_by {|k, v| k}.each do |k, v| -%> <%= k %> = <%= v %> <%- end -%> } @@ -37,10 +37,10 @@ object NotificationCommand "<%= @object_notificationcommandname %>" { <%- end -%> <%- if @vars.empty? != true -%> - <%- @vars.each_pair do |key,value| -%> + <%- @vars.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <% if value.class == String %><%= value %> <%- else -%>{ - <%- value.each_pair do |k,v| -%> + <%- value.sort_by {|k, v| k}.each do |k, v| -%> <%= k %> = <%= v %> <%- end -%> } @@ -54,7 +54,7 @@ object NotificationCommand "<%= @object_notificationcommandname %>" { <%- if @env.empty? != true -%> env = { - <%- @env.each_pair do |key,value| -%> + <%- @env.sort_by {|key, value| key}.each do |key, value| -%> <%= key %> = <%= value %> <%- end -%> } diff --git a/templates/object_scheduleddowntime.conf.erb b/templates/object_scheduleddowntime.conf.erb index 88e2875..1c0df36 100644 --- a/templates/object_scheduleddowntime.conf.erb +++ b/templates/object_scheduleddowntime.conf.erb @@ -30,7 +30,7 @@ object ScheduledDowntime "<%= @object_scheduleddowntimename %>" { <%- if @ranges.empty? != true -%> ranges = { - <%- @ranges.each_pair do |key, value| -%> + <%- @ranges.sort_by {|key, value| key}.each do |key, value| -%> "<%= key %>" = "<%= value %>" <%- end -%> } diff --git a/templates/object_service.conf.erb b/templates/object_service.conf.erb index 5c5f3b3..95d29b0 100644 --- a/templates/object_service.conf.erb +++ b/templates/object_service.conf.erb @@ -26,7 +26,7 @@ object Service "<%= @object_servicename %>" { groups = [ <%- @groups.each do |group| -%> "<%= group %>", <%- end -%>] <%- end -%> <%- if @vars.empty? != true -%> - <%- @vars.each_pair do |key, value| -%> + <%- @vars.sort_by {|key, value| key}.each do |key, value| -%> vars.<%= key %> = "<%= value %>" <%- end -%> <%- end -%> diff --git a/templates/object_timeperiod.conf.erb b/templates/object_timeperiod.conf.erb index 4c6e899..7b983b6 100644 --- a/templates/object_timeperiod.conf.erb +++ b/templates/object_timeperiod.conf.erb @@ -23,7 +23,7 @@ object TimePeriod "<%= @object_name %>" { <%- end -%> <%- if @ranges.empty? != true -%> ranges = { - <%- @ranges.each_pair do |key,value| -%> + <%- @ranges.sort_by {|key, value| key}.each do |key, value| -%> "<%= key %>" = "<%= value %>" <%- end -%> } diff --git a/templates/object_user.conf.erb b/templates/object_user.conf.erb index 0965295..d271160 100644 --- a/templates/object_user.conf.erb +++ b/templates/object_user.conf.erb @@ -29,7 +29,7 @@ object User "<%= @object_username %>" { enable_notifications = <%= @enable_notifications %> <%- end %> <%- if @vars.empty? != true -%> - <%- @vars.each_pair do |key, value| -%> + <%- @vars.sort_by {|key, value| key}.each do |key, value| -%> vars.<%= key %> = "<%= value %>" <%- end -%> <%- end -%> @@ -45,4 +45,4 @@ object User "<%= @object_username %>" { <%- if @states.length != 0 -%> states = [ <%- @states.each do |state| -%> <%= state %>, <%- end -%>] <%- end -%> -} \ No newline at end of file +} From 785fca83756f76f8903751ca5943a95970a1a9f0 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Tue, 13 Jan 2015 20:27:20 -0800 Subject: [PATCH 61/79] CHANGELOG updates. --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae172ac..6ab0d3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ * Feature: [PR-70](https://github.com/Icinga/puppet-icinga2/pull/70) and [dev.icinga.org issue #8153](https://dev.icinga.org/issues/8153): Change validation of interval parameters. * Feature: [PR-68](https://github.com/Icinga/puppet-icinga2/pull/68) and [dev.icinga.org issue #7346](https://dev.icinga.org/issues/7346): Added OS support for Red Hat. * Feature: [dev.icinga.org issue #7231](https://dev.icinga.org/issues/7231): Added an `ApiListener` object defined type. +* Feature: [PR-76](https://github.com/Icinga/puppet-icinga2/pull/76) and [dev.icinga.org issue #8154](https://dev.icinga.org/issues/8154): Ensure ordering of hashes in ERB templates + ###v0.6.1 (December 2nd, 2014) From 4b27f4c13f2a967639cb4918c4ec711d02aa62ee Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Tue, 13 Jan 2015 20:44:25 -0800 Subject: [PATCH 62/79] CHANGELOG updates. --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ab0d3c..b873141 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,8 @@ * Feature: [PR-68](https://github.com/Icinga/puppet-icinga2/pull/68) and [dev.icinga.org issue #7346](https://dev.icinga.org/issues/7346): Added OS support for Red Hat. * Feature: [dev.icinga.org issue #7231](https://dev.icinga.org/issues/7231): Added an `ApiListener` object defined type. * Feature: [PR-76](https://github.com/Icinga/puppet-icinga2/pull/76) and [dev.icinga.org issue #8154](https://dev.icinga.org/issues/8154): Ensure ordering of hashes in ERB templates - +* Bug: [PR-75](https://github.com/Icinga/puppet-icinga2/pull/75): Use `$ipaddress` as the default fact for IP addresses in `icinga2::object::host` definitions; `$ipaddress_eth0` won't work on systems with systemd that use consistent network device naming. +* Bug: [PR-74](https://github.com/Icinga/puppet-icinga2/pull/74): Remove the empty `icinga2` and `icinga2::obect` classes. ###v0.6.1 (December 2nd, 2014) From 5d6fc45ed4c75357922f2be5d3b45f5c77392f1e Mon Sep 17 00:00:00 2001 From: Tom De Vylder Date: Wed, 14 Jan 2015 13:10:08 +0100 Subject: [PATCH 63/79] Add inline checkplugin file distribution method --- manifests/checkplugin.pp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/manifests/checkplugin.pp b/manifests/checkplugin.pp index 968695b..45e2012 100644 --- a/manifests/checkplugin.pp +++ b/manifests/checkplugin.pp @@ -13,6 +13,7 @@ define icinga2::checkplugin ( $checkplugin_template_module = 'icinga2', $checkplugin_template = undef, $checkplugin_source_file = undef, + $checkplugin_source_inline = undef, ) { #Do some validation of the class' parameters: @@ -41,6 +42,15 @@ define icinga2::checkplugin ( require => Package[$icinga2::params::icinga2_client_packages], } } + elsif $checkplugin_file_distribution_method == 'inline' { + file { "${checkplugin_libdir}/${checkplugin_name}": + owner => $checkplugin_target_file_owner, + group => $checkplugin_target_file_group, + mode => $checkplugin_target_file_mode, + content => $checkplugin_source_inline, + require => Package[$icinga2::params::icinga2_client_packages], + } + } else { notify {'Missing/Incorrect File Distribution Method': message => 'The parameter checkplugin_file_distribution_method is missing or incorrect. Please set content or source', From b5b8ecadd346d853c85b5ecc172cfb0c8ff6870b Mon Sep 17 00:00:00 2001 From: Alexandre Beche Date: Thu, 15 Jan 2015 14:28:15 +0100 Subject: [PATCH 64/79] Fixing interval typo in object_notification.conf.erb Signed-off-by: Alexandre Beche --- templates/object_notification.conf.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/object_notification.conf.erb b/templates/object_notification.conf.erb index 4ec5931..61393e0 100644 --- a/templates/object_notification.conf.erb +++ b/templates/object_notification.conf.erb @@ -54,7 +54,7 @@ object Notification "<%= @object_notificationname %>" { <%- end -%> <%- if @interval -%> - interval = <%= @inteval %> + interval = <%= @interval %> <%- end -%> <%- if @period -%> From 1a6cb2c467eb9cce769fbce4e1aa027dab09edb0 Mon Sep 17 00:00:00 2001 From: Tom De Vylder Date: Thu, 15 Jan 2015 17:03:35 +0100 Subject: [PATCH 65/79] Document checkplugin_source_inline parameter --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 779a381..b360e3a 100644 --- a/README.md +++ b/README.md @@ -296,6 +296,23 @@ icinga2::checkplugin { 'check_diskstats': } ```` +Example 3: Distribute check plugin in a manifest +``` +icinga2::checkplugin { 'check_diskstats': + checkplugin_file_distribution_method => 'inline' + checkplugin_source_inline => 'command[check_disks]=/usr/lib64/nagios/plugins/check_disk -w 20 -c 10 -p /' +} +``` + +Example 4: Distribute check plugin stored in Hiera(-yaml) +``` +--- +icinga2::checkplugin: + check_diskstats: + checkplugin_file_distribution_method: 'inline' + checkplugin_source_inline: 'command[check_disks]=/usr/lib64/nagios/plugins/check_disk -w 20 -c 10 -p /' +``` + ###[Object type usage](id:object_type_usage) This module includes several defined types that can be used to automatically generate Icinga 2 format object definitions. They function in a similar way to [the built-in Nagios types that are included in Puppet](http://docs.puppetlabs.com/guides/exported_resources.html#exported-resources-with-nagios). From 6061d4bdc7dbf4af664f38620ad2bbfa3b75f021 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Thu, 15 Jan 2015 20:53:23 -0800 Subject: [PATCH 66/79] CHANGELOG updates. --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b873141..fd37a9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ * Feature: [PR-76](https://github.com/Icinga/puppet-icinga2/pull/76) and [dev.icinga.org issue #8154](https://dev.icinga.org/issues/8154): Ensure ordering of hashes in ERB templates * Bug: [PR-75](https://github.com/Icinga/puppet-icinga2/pull/75): Use `$ipaddress` as the default fact for IP addresses in `icinga2::object::host` definitions; `$ipaddress_eth0` won't work on systems with systemd that use consistent network device naming. * Bug: [PR-74](https://github.com/Icinga/puppet-icinga2/pull/74): Remove the empty `icinga2` and `icinga2::obect` classes. +* Feature: [PR-77](https://github.com/Icinga/puppet-icinga2/pull/77/) and [dev.icinga.org issue #8239](https://dev.icinga.org/issues/8239): Added the ability to specify the contents of check plugins inline. +* Bug: [PR-81](https://github.com/Icinga/puppet-icinga2/pull/81): Fixed typo in the ERB template for `Notification` objects. + + ###v0.6.1 (December 2nd, 2014) From e3f7adae82d081ee94dfc804d9856fb1e0d9267b Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Thu, 15 Jan 2015 20:54:28 -0800 Subject: [PATCH 67/79] Fixed typos in a Puppet code sample in the README; added , to the end of the lines with the parameters. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ffdd621..78b36e7 100644 --- a/README.md +++ b/README.md @@ -299,8 +299,8 @@ icinga2::checkplugin { 'check_diskstats': Example 3: Distribute check plugin in a manifest ``` icinga2::checkplugin { 'check_diskstats': - checkplugin_file_distribution_method => 'inline' - checkplugin_source_inline => 'command[check_disks]=/usr/lib64/nagios/plugins/check_disk -w 20 -c 10 -p /' + checkplugin_file_distribution_method => 'inline', + checkplugin_source_inline => 'command[check_disks]=/usr/lib64/nagios/plugins/check_disk -w 20 -c 10 -p /', } ``` From 9b3abbd2ff1b02d3c36e24bc0f3ddf539f245fac Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Thu, 15 Jan 2015 20:57:10 -0800 Subject: [PATCH 68/79] Removed the require => parameters on the file resources for check plugins since a check plugin command definition won't necessarily require the Nagios monitoring plugin packages. --- manifests/checkplugin.pp | 3 --- 1 file changed, 3 deletions(-) diff --git a/manifests/checkplugin.pp b/manifests/checkplugin.pp index 45e2012..1d8d477 100644 --- a/manifests/checkplugin.pp +++ b/manifests/checkplugin.pp @@ -30,7 +30,6 @@ define icinga2::checkplugin ( group => $checkplugin_target_file_group, mode => $checkplugin_target_file_mode, content => template("${checkplugin_template_module}/${checkplugin_template}"), - require => Package[$icinga2::params::icinga2_client_packages], } } elsif $checkplugin_file_distribution_method == 'source' { @@ -39,7 +38,6 @@ define icinga2::checkplugin ( group => $checkplugin_target_file_group, mode => $checkplugin_target_file_mode, source => $checkplugin_source_file, - require => Package[$icinga2::params::icinga2_client_packages], } } elsif $checkplugin_file_distribution_method == 'inline' { @@ -48,7 +46,6 @@ define icinga2::checkplugin ( group => $checkplugin_target_file_group, mode => $checkplugin_target_file_mode, content => $checkplugin_source_inline, - require => Package[$icinga2::params::icinga2_client_packages], } } else { From 099b308c4ded6d99d735b7916f8947d909e50818 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sat, 24 Jan 2015 20:07:13 -0800 Subject: [PATCH 69/79] Merged in support for Red Hat operating systems. Merged in from: https://github.com/Icinga/puppet-icinga2/pull/83/ --- README.md | 9 +++++++++ manifests/params.pp | 27 ++++++++++++++++++--------- manifests/server.pp | 2 +- manifests/server/install.pp | 7 +++---- metadata.json | 8 ++++++++ 5 files changed, 39 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 78b36e7..82f50ca 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,15 @@ For Ubuntu systems, this module requires the [Puppet Labs apt module](https://gi On EL-based systems (CentOS, Red Hat Enterprise Linux, Fedora, etc.), the [EPEL package repository](https://fedoraproject.org/wiki/EPEL) is required. You can also use the [icinga2::nrpe class](#nrpe-usage) to set up NRPE on CentOS 5. It is discouraged to set up Icinga2 Server on this old of a distribution. You are encouraged to use at least CentOS 6 or higher. +####Note for RedHat + +If you are using RedHat Satellite server, set +
+   $manage_repos = false
+
+ +in `icinga2::server` class and make sure, you have a channel set up with the contents of the icinga2 repository and the needed packages from EPEL. If you leave it at true, the EPEL repository will be used directly. + If you would like to use the `icinga2::object` defined types as [exported resources](https://docs.puppetlabs.com/guides/exported_resources.html), you'll need to have your Puppet master set up with PuppetDB. See the Puppet Labs documentation for more info: [Docs: PuppetDB](https://docs.puppetlabs.com/puppetdb/) ###Server requirements diff --git a/manifests/params.pp b/manifests/params.pp index cd674ba..862a2ba 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -18,14 +18,20 @@ class icinga2::params { ################## # Icinga 2 common package parameters case $::operatingsystem { - #CentOS systems: + #CentOS or RedHat systems: 'CentOS', 'RedHat': { + #Pick the right package provider: + $package_provider = 'yum' + } + + #RedHat systems: + 'RedHat': { #Pick the right package provider: $package_provider = 'yum' } - #Ubuntu systems: - 'Ubuntu': { + #Ubuntu systems: + 'Ubuntu': { #Pick the right package provider: $package_provider = 'apt' } @@ -95,9 +101,9 @@ class icinga2::params { } } - #Ubuntu systems: - 'Ubuntu': { - case $::operatingsystemrelease { + #Ubuntu systems: + 'Ubuntu': { + case $::operatingsystemrelease { #Ubuntu 12.04 doesn't have nagios-plugins-common or nagios-plugins-contrib packages available... '12.04': { $icinga2_server_package = 'icinga2' @@ -143,7 +149,7 @@ class icinga2::params { # Icinga 2 server config parameters case $::operatingsystem { - #CentOS systems: + #CentOS or RedHat systems: 'CentOS', 'RedHat': { #Settings for /etc/icinga2/: $etc_icinga2_owner = 'icinga' @@ -322,6 +328,7 @@ class icinga2::params { $nrpe_user = 'nrpe' $nrpe_group = 'nrpe' } + #File and template variable names for Ubuntu systems: 'Ubuntu': { $nrpe_config_basedir = '/etc/nagios' @@ -331,6 +338,7 @@ class icinga2::params { $nrpe_user = 'nagios' $nrpe_group = 'nagios' } + #File and template variable names for Ubuntu systems: 'Debian': { $nrpe_config_basedir = '/etc/nagios' @@ -340,14 +348,15 @@ class icinga2::params { $nrpe_user = 'nagios' $nrpe_group = 'nagios' } - #Fail if we're on any other OS: + + #Fail if we're on any other OS: default: { fail("${::operatingsystem} is not supported!") } } ################## # Icinga 2 client package parameters case $::operatingsystem { - #CentOS systems: + #CentOS or RedHat systems: 'CentOS', 'RedHat': { case $::operatingsystemmajrelease { '5': { diff --git a/manifests/server.pp b/manifests/server.pp index 32d9932..b441e4b 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -44,7 +44,7 @@ class icinga2::server ( #Pick set the right path where we can find the DB schema based on the OS... case $::operatingsystem { - 'CentOS': { + 'CentOS','RedHat': { #...and database that the user picks case $server_db_type { 'mysql': { $server_db_schema_path = '/usr/share/icinga2-ido-mysql/schema/mysql.sql' } diff --git a/manifests/server/install.pp b/manifests/server/install.pp index 851926b..507d6e3 100644 --- a/manifests/server/install.pp +++ b/manifests/server/install.pp @@ -32,9 +32,8 @@ class icinga2::server::install::repos inherits icinga2::server { if $manage_repos == true { case $::operatingsystem { - #CentOS systems: + #CentOS or RedHat systems: 'CentOS', 'RedHat': { - #Add the official Icinga Yum repository: http://packages.icinga.org/epel/ yumrepo { 'icinga2_yum_repo': baseurl => "http://packages.icinga.org/epel/${::operatingsystemmajrelease}/release/", @@ -45,8 +44,8 @@ class icinga2::server::install::repos inherits icinga2::server { } } - #Ubuntu systems: - 'Ubuntu': { + #Ubuntu systems: + 'Ubuntu': { #Include the apt module's base class so we can... include apt #...use the apt module to add the Icinga 2 PPA from launchpad.net: diff --git a/metadata.json b/metadata.json index 676dd43..871534d 100644 --- a/metadata.json +++ b/metadata.json @@ -16,6 +16,14 @@ "7" ] }, + { + "operatingsystem": "RedHat", + "operatingsystemmajrelease": [ + "5", + "6", + "7" + ] + }, { "operatingsystem": "Debian", "operatingsystemmajrelease": [ From 65c74229c9dec42c5e06dd7edb00d17416699462 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sat, 24 Jan 2015 20:13:42 -0800 Subject: [PATCH 70/79] CHANGELOG update.. --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd37a9d..60a4582 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,8 +15,7 @@ * Bug: [PR-74](https://github.com/Icinga/puppet-icinga2/pull/74): Remove the empty `icinga2` and `icinga2::obect` classes. * Feature: [PR-77](https://github.com/Icinga/puppet-icinga2/pull/77/) and [dev.icinga.org issue #8239](https://dev.icinga.org/issues/8239): Added the ability to specify the contents of check plugins inline. * Bug: [PR-81](https://github.com/Icinga/puppet-icinga2/pull/81): Fixed typo in the ERB template for `Notification` objects. - - +* Feature: [PR-83](https://github.com/Icinga/puppet-icinga2/pull/83): Added Red Hat support. ###v0.6.1 (December 2nd, 2014) From 0a9dd7dff3b22af3b7c320f7a96d62158cc28569 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sat, 24 Jan 2015 20:45:09 -0800 Subject: [PATCH 71/79] Squashed commit of the following: commit d0bbdbd2011b4941150d3aff00306e7b7cc15b02 Merge: 65c7422 e12b55c Author: Nick Chappell Date: Sat Jan 24 20:25:50 2015 -0800 Merge branch '7228' of https://github.com/cropalato/puppet-icinga2 into cropalato-7228 commit e12b55cf8c2ca266572d809a540ce9064e3d97b2 Merge: 58b2cd8 ad3b05d Author: Ricardo Melo Date: Mon Jan 12 11:42:58 2015 -0500 Merge branch '7228' of https://github.com/cropalato/puppet-icinga2 into 7228 commit 58b2cd8f2dc4a06b1450bb246c83d484b29903b9 Author: ricardo@cropalato.com.br Date: Tue Nov 25 18:22:51 2014 -0500 Added enable_ha parameter. * fixed default parameter value Fix the exec resource commands so they use the new commands in 2.2 to enable/disable features instead of the old ones from 2.1 and before. refs#7714 : https://dev.icinga.org/issues/7714 Fixed a bug where features were not actually being enabled/disabled because the order of the words in the subcommands was wrong. refs#7916 : https://dev.icinga.org/issues/7916 Added refresh_icinga2_service parameters to each of the object defined types so that they can be used by themselves if the module isn't being used to also manage the Icinga 2 service. refs# 7856 : https://dev.icinga.org/issues/7856 CHANGELOG update for https://dev.icinga.org/issues/7856 refs #7856 : https://dev.icinga.org/issues/7856 Added a README note about the refresh_icinga2_service parameter. refs#7856 : https://dev.icinga.org/issues/7856 CHANGELOG release version date. Added refresh_icinga2_service parameters to each of the object defined types so that they can be used by themselves if the module isn't being used to also manage the Icinga 2 service. refs# 7856 : https://dev.icinga.org/issues/7856 CHANGELOG update for https://dev.icinga.org/issues/7856 refs #7856 : https://dev.icinga.org/issues/7856 Added a README note about the refresh_icinga2_service parameter. refs#7856 : https://dev.icinga.org/issues/7856 CHANGELOG release version date. Update object_host.conf.erb Added routine for cases where the value of a vars variable is a hash. Merged from: https://github.com/Icinga/puppet-icinga2/pull/58 refs#8156: https://dev.icinga.org/issues/8156 Changelog update. refs#8156: https://dev.icinga.org/issues/8156 Removed an extra .each line. Adding EndPoint Object. #7232 Merged from: https://github.com/Icinga/puppet-icinga2/pull/63 refs#7232: https://dev.icinga.org/issues/7232 * fixed typo Merged from: https://github.com/Icinga/puppet-icinga2/pull/63 refs#7232: https://dev.icinga.org/issues/7232 * fixed typo Merged from: https://github.com/Icinga/puppet-icinga2/pull/63 refs#7232: https://dev.icinga.org/issues/7232 * fixed default parameter value Merged from: https://github.com/Icinga/puppet-icinga2/pull/63 refs#7232: https://dev.icinga.org/issues/7232 Fixed a typo in the ERB template for the Endpoint object. 'Endpoint' should only have a capital E, not a capital P. Fixed typo in file path. Changelog update. Adding IcingaStatusWriter object. #7230 * fixed typo Changelog update. Adding FileLogger object. #7229. * fixed default parameter value Changelog update. typo. updating validation of interval to allow resending of alerts to be disabled Merged from: https://github.com/Icinga/puppet-icinga2/pull/70 refs#8153: https://dev.icinga.org/issues/8153 fixing typo in interval name in templates Merged from: https://github.com/Icinga/puppet-icinga2/pull/70 refs#8153: https://dev.icinga.org/issues/8153 Adding IcingaStatusWriter object. #7230 * fixed typo Changelog update. Adding FileLogger object. #7229. * fixed default parameter value typo. Changelog update. Adding support for RedHat Changelog update. Updated metadata.json to reflect that Red Hat is supported. Updated the version number in metadata.json to reflect the current version. Typo. Added a Gemfile that has gems listed for basic Puppet unit tests. Added a .gitignore rule. Added a Rake file with a unit_tests task that runs the lint task. Added some config options for puppet-lint. Added an ApiListener object defined type. refs#7231 : https://dev.icinga.org/issues/7231 Changelog update. Fixed typo in README.md Add a target_file_ensure parameter to the ApiListener object defined type. Added a full variable scope. Fix C/C++ style comments so they use # instead. Use 2 spaces instead of a tab character. Removed a trailing space. Removed trailing whitespace. Fixed whitespace alignment in the icinga2::server::config class. Fixed whitespace alignment in the icinga2::server::install class. Disable puppet-lint variable scope checks. Disable puppet-lint class autoloader layout checks. Fixing target_dir defult value. commit ad3b05dd39bba6b5f82211cccbb0aca209bd777e Author: Ricardo Melo Date: Mon Jan 12 11:25:57 2015 -0500 Fixing target_dir defult value. commit 0cdb176f6920dde33b91207ac3ecb0457de7fb08 Merge: 88b3fb1 f238155 Author: Ricardo Melo Date: Mon Jan 12 11:19:57 2015 -0500 Merge remote-tracking branch 'upstream/develop' into 7228 commit 88b3fb1e3ed4d5d7a2c98b0e43e10ee4e1dbc1b2 Author: Ricardo Melo Date: Tue Dec 2 15:14:21 2014 -0500 * fixed default parameter value commit d369b81f8472c5931b8a073cc26518bf1ecb84a4 Author: ricardo@cropalato.com.br Date: Tue Nov 25 18:22:51 2014 -0500 Added enable_ha parameter. commit 6bf34cb4af2322020c7553016af17b84effd6dc3 Author: ricardo@cropalato.com.br Date: Tue Nov 25 18:07:52 2014 -0500 Adding NotificationComponent Object. #7228. --- README.md | 25 ++++++++++++ manifests/object/notificationcomponent.pp | 40 +++++++++++++++++++ .../object_notificationcomponent.conf.erb | 19 +++++++++ 3 files changed, 84 insertions(+) create mode 100644 manifests/object/notificationcomponent.pp create mode 100644 templates/object_notificationcomponent.conf.erb diff --git a/README.md b/README.md index 82f50ca..32f2807 100644 --- a/README.md +++ b/README.md @@ -437,6 +437,7 @@ Object types: * [icinga2::object::livestatuslistener](#icinga2objectlivestatuslistener) * [icinga2::object::notification](#icinga2objectnotification) * [icinga2::object::notificationcommand](#icinga2objectnotificationcommand) +* [icinga2::object::notificationcomponent](#icinga2objectnotificationcomponent) * [icinga2::object::perfdatawriter](#icinga2objectperfdatawriter) * [icinga2::object::scheduleddowntime](#icinga2objectscheduleddowntime) * [icinga2::object::service](#icinga2objectservice) @@ -873,6 +874,30 @@ icinga2::object::notificationcommand { 'mail-service-notification': This object use the same parameter defined to `checkcommand`. +####[`icinga2::object::notificationcomponent`](id:object_notificationcomponent) + +The `notificationcomponent` defined type can create `notificationcomponent` objects. + +Example: + +
 
+icinga2::object::notificationcomponent {'notification':} 
+
+ +This object support the following parameters: +* `ensure` - Optional parameter used to remove or create the file, Default value is 'file'. Use 'absent' to remove the file. +* `object_name` - Optional. Used to define file name. default value is 'checker' +* `enable_ha` - Optional. Enable the high availability functionality. Only valid in a cluster setup. Default value is true. +* `target_dir` - Optional. Define where the conf fil will be created. Default value is '/etc/icinga2/features-avalable' +* `target_file_name` - Optional. Define the file name. Default value is '${object_name}.conf'. +* `target_file_owner` - Optional. File Owner. Default value is 'root'. +* `target_file_group` - Optional. File Group. Default value is 'root'. +* `target_file_mode` - Optional. File Mode. Default value is '0644'. + +See [NotificationComponent](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-notificationcomponent) on [docs.icinga.org](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc) for more details about this object. + +Should be enable/disable using `icinga2::server::features::enable` or `icinga2::server::features::disable`. + ####[`icinga2::object::perfdatawriter`](id:object_perfdatawriter) This defined type creates a **PerfdataWriter** object diff --git a/manifests/object/notificationcomponent.pp b/manifests/object/notificationcomponent.pp new file mode 100644 index 0000000..9c8dec0 --- /dev/null +++ b/manifests/object/notificationcomponent.pp @@ -0,0 +1,40 @@ +# == Defined type: icinga2::object::notificationcomponent +# +# This is a defined type for Icinga 2 apply objects that create Notification Component +# See the following Icinga 2 doc page for more info: +# http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-notificationcomponent +# +# === Parameters +# +# See the inline comments. +# + +define icinga2::object::notificationcomponent ( + $ensure = 'file', + $object_name = $name, + $enable_ha = undef, + $target_dir = '/etc/icinga2/features-avalable', + $target_file_name = "${name}.conf", + $target_file_owner = 'root', + $target_file_group = 'root', + $target_file_mode = '0644' +) { + + if $enable_ha { + validate_bool($enable_ha) + } + validate_string($target_dir) + validate_string($target_file_name) + validate_string($target_file_owner) + validate_string($target_file_group) + validate_re($target_file_mode, '^\d{4}$') + + file {"${target_dir}/${target_file_name}": + ensure => $ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_notificationcomponent.conf.erb'), +# notify => Service['icinga2'], # Dont need to reload/restart the service only enable/disable the feature. Should we force enable/disable the feature (icinga2 feature enable notification) or should the user define it? + } +} diff --git a/templates/object_notificationcomponent.conf.erb b/templates/object_notificationcomponent.conf.erb new file mode 100644 index 0000000..c288e7e --- /dev/null +++ b/templates/object_notificationcomponent.conf.erb @@ -0,0 +1,19 @@ +/** +* WARNING: This NotificationComponent is automatically generated by Puppet. +* ANY MANUAL CHANGES TO IT WILL GET OVERWRITTEN! +*/ + +/** +* A NotificationComponent definition. You can create your own configuration files +* in the conf.d directory (e.g. one per commnand). By default all *.conf +* files in this directory are included. +* +*/ + +library "notification" + +object NotificationComponent "<%= @object_name %>" { + <%- if @enable_ha != true -%> + enable_ha = false + <%- end -%> +} From a829771fd6d28545e2cb1c678a654e4329dc1c56 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sat, 24 Jan 2015 20:45:25 -0800 Subject: [PATCH 72/79] Fix typos. --- README.md | 2 +- manifests/object/notificationcomponent.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 32f2807..64cc4a9 100644 --- a/README.md +++ b/README.md @@ -888,7 +888,7 @@ This object support the following parameters: * `ensure` - Optional parameter used to remove or create the file, Default value is 'file'. Use 'absent' to remove the file. * `object_name` - Optional. Used to define file name. default value is 'checker' * `enable_ha` - Optional. Enable the high availability functionality. Only valid in a cluster setup. Default value is true. -* `target_dir` - Optional. Define where the conf fil will be created. Default value is '/etc/icinga2/features-avalable' +* `target_dir` - Optional. Define where the conf fil will be created. Default value is '/etc/icinga2/features-available' * `target_file_name` - Optional. Define the file name. Default value is '${object_name}.conf'. * `target_file_owner` - Optional. File Owner. Default value is 'root'. * `target_file_group` - Optional. File Group. Default value is 'root'. diff --git a/manifests/object/notificationcomponent.pp b/manifests/object/notificationcomponent.pp index 9c8dec0..01a5a11 100644 --- a/manifests/object/notificationcomponent.pp +++ b/manifests/object/notificationcomponent.pp @@ -13,7 +13,7 @@ define icinga2::object::notificationcomponent ( $ensure = 'file', $object_name = $name, $enable_ha = undef, - $target_dir = '/etc/icinga2/features-avalable', + $target_dir = '/etc/icinga2/features-available', $target_file_name = "${name}.conf", $target_file_owner = 'root', $target_file_group = 'root', From 9ddb69609f58efab57311ff9e9d262c1975798e2 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sat, 24 Jan 2015 20:51:09 -0800 Subject: [PATCH 73/79] CHANGELOG update. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60a4582..b65f1c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ * Feature: [PR-77](https://github.com/Icinga/puppet-icinga2/pull/77/) and [dev.icinga.org issue #8239](https://dev.icinga.org/issues/8239): Added the ability to specify the contents of check plugins inline. * Bug: [PR-81](https://github.com/Icinga/puppet-icinga2/pull/81): Fixed typo in the ERB template for `Notification` objects. * Feature: [PR-83](https://github.com/Icinga/puppet-icinga2/pull/83): Added Red Hat support. +* Feature: [PR-60](https://github.com/Icinga/puppet-icinga2/pull/60) and [dev.icinga.org issue #7228](https://dev.icinga.org/issues/7228): Added a NotificationComponent object defined type. ###v0.6.1 (December 2nd, 2014) From 232d8bea753cc8631e93105c17a33083dc0082b6 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sat, 24 Jan 2015 21:11:45 -0800 Subject: [PATCH 74/79] Merged in from: https://github.com/Icinga/puppet-icinga2/pull/59 Squashed commit of the following: commit 3485ced372df47d22c5495f188746a767448b301 Merge: 9ddb696 cd0cd09 Author: Nick Chappell Date: Sat Jan 24 21:05:50 2015 -0800 Merge branch '7227' of https://github.com/cropalato/puppet-icinga2 into cropalato-7227 commit cd0cd09733c0881e62b57cef871fa7898e47c186 Author: Ricardo Melo Date: Tue Dec 2 15:09:49 2014 -0500 * fixed default parameter value commit 1a01e8f68dd8ac2f6bbf8ffa040673d97bec9280 Author: ricardo@cropalato.com.br Date: Tue Nov 25 18:01:18 2014 -0500 * fixed typo. commit e23aafc87877617ee1faba1b9d4b4c595d84ae8e Author: ricardo@cropalato.com.br Date: Tue Nov 25 17:44:58 2014 -0500 Adding CheckerComponent Object. #7227 --- README.md | 22 +++++++++++++ manifests/object/checkercomponent.pp | 36 ++++++++++++++++++++++ templates/object_checkercomponent.conf.erb | 15 +++++++++ 3 files changed, 73 insertions(+) create mode 100644 manifests/object/checkercomponent.pp create mode 100644 templates/object_checkercomponent.conf.erb diff --git a/README.md b/README.md index 64cc4a9..8b152c9 100644 --- a/README.md +++ b/README.md @@ -424,6 +424,7 @@ Object types: * [icinga2::object::applynotificationtoservice](#icinga2objectapplynotificationtoservice) * [icinga2::object::checkcommand](#icinga2objectcheckcommand) * [icinga2::object::compatlogger](#icinga2objectcompatlogger) +* [icinga2::object::checkercomponent](#icinga2objectcheckercomponent) * [icinga2::object::checkresultreader](#icinga2objectcheckresultreader) * [icinga2::object::endpoint](#icinga2objectendpoint) * [icinga2::object::eventcommand](#icinga2objecteventcommand) @@ -600,6 +601,27 @@ icinga2::object::compatlogger { 'daily-log': Both patameters as optionals. The parameter `rotation_method` can one of `HOURLY`, `DAILY`, `WEEKLY` or `MONTHY`. See [CompatLogger](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-compatlogger) on [docs.icinga.org](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc) for a full list of parameters. +####[`icinga2::object::checkercomponent`](id:object_checkercomponent) + +The `checkercomponent` defined type can create `checkercomponent` objects. + +Example: + +
+icinga2::object::checkercomponent {'checker':}
+
+ +This object support the following parameters: +* `ensure` - Optional parameter used to remove or create the file, Default value is 'file'. Use 'absent' to remove the file. +* `object_name` - Optional. Used to define file name. default value is 'checker' +* `target_dir` - Optional. Define where the conf fil will be created. Default value is '/etc/icinga2/conf.d' +* `target_file_name` - Optional. Define the file name. Default value is '${object_name}.conf'. +* `target_file_owner` - Optional. File Owner. Default value is 'root'. +* `target_file_group` - Optional. File Group. Default value is 'root'. +* `target_file_mode` - Optional. File Mode. Default value is '0644'. + +See [CheckerComponent](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-checkercomponent) on [docs.icinga.org](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc) for more details about this object. + ####[`icinga2::object::checkresultreader`](id:object_checkresultreader) The `checkresultreader` defined type can create `checkresultreader` objects. diff --git a/manifests/object/checkercomponent.pp b/manifests/object/checkercomponent.pp new file mode 100644 index 0000000..196adce --- /dev/null +++ b/manifests/object/checkercomponent.pp @@ -0,0 +1,36 @@ +# == Defined type: icinga2::object::checkercomponent +# +# This is a defined type for Icinga 2 apply objects that create Checker Component +# See the following Icinga 2 doc page for more info: +# http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-checkercomponent +# +# === Parameters +# +# See the inline comments. +# + +define icinga2::object::checkercomponent ( + $ensure = 'file', + $object_name = $name, + $target_dir = '/etc/icinga2/conf.d', + $target_file_name = "${name}.conf", + $target_file_owner = 'root', + $target_file_group = 'root', + $target_file_mode = '0644' +) { + + validate_string($target_dir) + validate_string($target_file_name) + validate_string($target_file_owner) + validate_string($target_file_group) + validate_re($target_file_mode, '^\d{4}$') + + file {"${target_dir}/${target_file_name}": + ensure => $ensure, + owner => $target_file_owner, + group => $target_file_group, + mode => $target_file_mode, + content => template('icinga2/object_checkercomponent.conf.erb'), +# notify => Service['icinga2'], # Dont need to reload/restart the service only enable/disable the feature. Should we force enable/disable the feature (icinga2 feature enable checker) or should the user define it? + } +} diff --git a/templates/object_checkercomponent.conf.erb b/templates/object_checkercomponent.conf.erb new file mode 100644 index 0000000..af40bf4 --- /dev/null +++ b/templates/object_checkercomponent.conf.erb @@ -0,0 +1,15 @@ +/** +* WARNING: This CheckerComponent is automatically generated by Puppet. +* ANY MANUAL CHANGES TO IT WILL GET OVERWRITTEN! +*/ + +/** +* A CheckerComponent definition. You can create your own configuration files +* in the conf.d directory (e.g. one per commnand). By default all *.conf +* files in this directory are included. +* +*/ + +library "checker" + +object CheckerComponent "<%= @object_name %>" { } From d075047746069e0311532ea52d45996ad155b25b Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sat, 24 Jan 2015 21:17:53 -0800 Subject: [PATCH 75/79] CHANGELOG update. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b65f1c1..60c148c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ * Bug: [PR-81](https://github.com/Icinga/puppet-icinga2/pull/81): Fixed typo in the ERB template for `Notification` objects. * Feature: [PR-83](https://github.com/Icinga/puppet-icinga2/pull/83): Added Red Hat support. * Feature: [PR-60](https://github.com/Icinga/puppet-icinga2/pull/60) and [dev.icinga.org issue #7228](https://dev.icinga.org/issues/7228): Added a NotificationComponent object defined type. +* Feature: [PR-59](https://github.com/Icinga/puppet-icinga2/pull/59) and [dev.icinga.org issue #7227](https://dev.icinga.org/issues/7227): Added a CheckerComponent object defined type. ###v0.6.1 (December 2nd, 2014) From 3c44c16ac1760540d59b79f28d0594f5b477b721 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sat, 24 Jan 2015 21:18:53 -0800 Subject: [PATCH 76/79] Changed the default target directory for CheckerComponent objects to the features-available directory. --- manifests/object/checkercomponent.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/object/checkercomponent.pp b/manifests/object/checkercomponent.pp index 196adce..7534b77 100644 --- a/manifests/object/checkercomponent.pp +++ b/manifests/object/checkercomponent.pp @@ -12,7 +12,7 @@ define icinga2::object::checkercomponent ( $ensure = 'file', $object_name = $name, - $target_dir = '/etc/icinga2/conf.d', + $target_dir = '/etc/icinga2/features-available', $target_file_name = "${name}.conf", $target_file_owner = 'root', $target_file_group = 'root', From ca583a8a823f28506674806766fcd1fa29571a19 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Sun, 25 Jan 2015 20:02:58 -0800 Subject: [PATCH 77/79] Add an @ to the severity variable so that the template doesn't break in future versions of Puppet. --- templates/object_filelogger.conf.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/object_filelogger.conf.erb b/templates/object_filelogger.conf.erb index aab83ef..5d6d0b3 100644 --- a/templates/object_filelogger.conf.erb +++ b/templates/object_filelogger.conf.erb @@ -12,7 +12,7 @@ object FileLogger "<%= @object_name %>" { <%- if @severity -%> - severity = "<%= severity -%>" + severity = "<%= @severity -%>" <%- end -%> path = "<%= @path -%>" } From 221db2b331aeb25f76d04332fd8379c655e796ce Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Thu, 29 Jan 2015 21:46:02 -0800 Subject: [PATCH 78/79] Squashed commit of the following: commit 11075072f476dd857d190d26cdb1091e2a8cb6f4 Merge: ca583a8 8e24b03 Author: Nick Chappell Date: Thu Jan 29 21:20:21 2015 -0800 Merge branch 'fix_apply_service_to_host_period' of https://github.com/arioch/puppet-icinga2 into arioch-fix_apply_service_to_host_period commit 8e24b03958c50a36a8ceaab2ce89b8876d89f6ed Author: Tom De Vylder Date: Wed Jan 28 14:28:10 2015 +0100 Fix undefined script variable error --- templates/object_apply_service_to_host.conf.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/object_apply_service_to_host.conf.erb b/templates/object_apply_service_to_host.conf.erb index e380810..4de9f85 100644 --- a/templates/object_apply_service_to_host.conf.erb +++ b/templates/object_apply_service_to_host.conf.erb @@ -43,7 +43,7 @@ apply Service "<%= @object_servicename %>" to Host { max_check_attempts = <%= @max_check_attempts %> <%- end -%> <%- if @check_period -%> - check_period = <%= @check_period %> + check_period = "<%= @check_period %>" <%- end -%> <%- if @check_interval -%> check_interval = <%= @check_interval %> From ecfc11289ec191773225c6130d89552998b6e3c5 Mon Sep 17 00:00:00 2001 From: Nick Chappell Date: Thu, 29 Jan 2015 21:49:31 -0800 Subject: [PATCH 79/79] CHANGELOG updates. --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60c148c..eeb6ff2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ #Changelog - - - -###v0.6.2 (unreleased) +###v0.6.2 (January 29th, 2015) * Feature: [PR-58](https://github.com/Icinga/puppet-icinga2/pull/58) and [dev.icinga.org issue #8156](https://dev.icinga.org/issues/8156): Added the ability to use hashes directly in host `vars` parameters (instead of rendering hashes into a series of `vars.` lines in the rendered object file). * Feature: [PR-63](https://github.com/Icinga/puppet-icinga2/pull/63) and [dev.icinga.org issue #7232](https://dev.icinga.org/issues/7232): Added an Endpoint object defined type. @@ -18,6 +18,8 @@ * Feature: [PR-83](https://github.com/Icinga/puppet-icinga2/pull/83): Added Red Hat support. * Feature: [PR-60](https://github.com/Icinga/puppet-icinga2/pull/60) and [dev.icinga.org issue #7228](https://dev.icinga.org/issues/7228): Added a NotificationComponent object defined type. * Feature: [PR-59](https://github.com/Icinga/puppet-icinga2/pull/59) and [dev.icinga.org issue #7227](https://dev.icinga.org/issues/7227): Added a CheckerComponent object defined type. +* Bug: [PR-88](https://github.com/Icinga/puppet-icinga2/pull/88): Fix unquoted string in the ERB template for apply objects that apply services to hosts. +* Feature: [PR-85](https://github.com/Icinga/puppet-icinga2/pull/85): Improve notifications of the NRPE daemon when config files or command definition files are changed. ###v0.6.1 (December 2nd, 2014)