Browse Source

Squashed commit of the following:

commit d0bbdbd2011b4941150d3aff00306e7b7cc15b02
Merge: 65c7422 e12b55c
Author: Nick Chappell <nick@intronic.org>
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 <ricardo.melo@gameloft.com>
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 <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 <ricardo.melo@gameloft.com>
Date:   Mon Jan 12 11:25:57 2015 -0500

    Fixing target_dir defult value.

commit 0cdb176f6920dde33b91207ac3ecb0457de7fb08
Merge: 88b3fb1 f238155
Author: Ricardo Melo <ricardo.melo@gameloft.com>
Date:   Mon Jan 12 11:19:57 2015 -0500

    Merge remote-tracking branch 'upstream/develop' into 7228

commit 88b3fb1e3ed4d5d7a2c98b0e43e10ee4e1dbc1b2
Author: Ricardo Melo <ricardo.melo@gameloft.com>
Date:   Tue Dec 2 15:14:21 2014 -0500

    * fixed default parameter value

commit d369b81f8472c5931b8a073cc26518bf1ecb84a4
Author: ricardo@cropalato.com.br <ricardo@cropalato.com.br>
Date:   Tue Nov 25 18:22:51 2014 -0500

    Added enable_ha parameter.

commit 6bf34cb4af2322020c7553016af17b84effd6dc3
Author: ricardo@cropalato.com.br <ricardo@cropalato.com.br>
Date:   Tue Nov 25 18:07:52 2014 -0500

    Adding NotificationComponent Object. #7228.
Nick Chappell 9 years ago
parent
commit
0a9dd7dff3

+ 25 - 0
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: 
+ 
+<pre> 
+icinga2::object::notificationcomponent {'notification':} 
+</pre> 
+ 
+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

+ 40 - 0
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?
+  }
+}

+ 19 - 0
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 -%>
+}