From d02eae3b5b6abbb65e90854243bd7cb15289c184 Mon Sep 17 00:00:00 2001 From: Ricardo Melo Date: Tue, 11 Nov 2014 18:24:15 -0500 Subject: [PATCH] * Applied comments made by nickchappell. Fixed identation and few typos on README.md. Tabularize define parameters. Signed-off-by: Nick Chappell Merged from: https://github.com/Icinga/puppet-icinga2/pull/36 refs#7216: https://dev.icinga.org/issues/7216 --- README.md | 18 ++++++------------ manifests/object/notification.pp | 32 ++++++++++++++++---------------- 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 343b812..10df515 100644 --- a/README.md +++ b/README.md @@ -560,17 +560,11 @@ The `notification` defined type can create `notification` objects.
 #Defining Create the mail notification command:
 icinga2::object::notification { 'localhost-ping-notification':
-
-  host_name = "localhost"
-
-  service_name = "ping4"
-
-  command = "mail-service-notification"
-
-  types = [ Problem, Recovery ]
-  }
+  host_name    => 'localhost',
+  service_name => 'ping4',
+  command      => 'mail-service-notification',
+  types        => [ 'Problem', 'Recovery' ]
 }
-
 
Available parameters are: @@ -593,9 +587,9 @@ Available parameters are: Notes on specific parameters: -* `vars`: needs to be a dictionary +* `vars`: needs to be a hash * `users`,`user_groups`,`types`,`states`: should be an array, see [Notification](http://docs.icinga.org/icinga2/latest/doc/module/icinga2/chapter/configuring-icinga2#objecttype-notification) for list of valid state and type filters -* `times`: needs to be a dictionary with `begin` and `end` attributes +* `times`: needs to be a hash with `begin` and `end` attributes * `interval`: needs to be a [number](https://docs.puppetlabs.com/puppet/latest/reference/lang_datatypes.html#numbers), not a quoted string diff --git a/manifests/object/notification.pp b/manifests/object/notification.pp index 611ded4..5f68388 100644 --- a/manifests/object/notification.pp +++ b/manifests/object/notification.pp @@ -11,22 +11,22 @@ define icinga2::object::notification ( $object_notificationname = $name, - $command = undef, - $host_name = undef, - $service_name = undef, - $vars = {}, - $users = [], - $user_groups = [], - $times = {}, - $interval = undef, - $period = undef, - $types = [], - $states = [], - $target_dir = '/etc/icinga2/objects/notifications', - $target_file_name = "${name}.conf", - $target_file_owner = 'root', - $target_file_group = 'root', - $target_file_mode = '0644' + $command = undef, + $host_name = undef, + $service_name = undef, + $vars = {}, + $users = [], + $user_groups = [], + $times = {}, + $interval = undef, + $period = undef, + $types = [], + $states = [], + $target_dir = '/etc/icinga2/objects/notifications', + $target_file_name = "${name}.conf", + $target_file_owner = 'root', + $target_file_group = 'root', + $target_file_mode = '0644' ) { #Do some validation of the class' parameters: