* Applied comments made by nickchappell. Fixed identation and few typos on README.md. Tabularize define parameters.

Signed-off-by: Nick Chappell <nick@intronic.org>

Merged from: https://github.com/Icinga/puppet-icinga2/pull/36

refs#7216: https://dev.icinga.org/issues/7216
This commit is contained in:
Ricardo Melo 2014-11-11 18:24:15 -05:00 committed by Nick Chappell
parent 09db5bba18
commit d02eae3b5b
2 changed files with 22 additions and 28 deletions

View file

@ -560,17 +560,11 @@ The `notification` defined type can create `notification` objects.
<pre>
#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' ]
}
</pre>
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

View file

@ -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: