[icinga-checkins] icinga.org: puppet-icinga2/master: adding methods attribute and allowing settable import template

git at icinga.org git at icinga.org
Wed Nov 12 06:50:11 CET 2014


Module: puppet-icinga2
Branch: master
Commit: 52f0d2583685cfee1eea3f6a642189b541da170b
URL:    https://git.icinga.org/?p=puppet-icinga2.git;a=commit;h=52f0d2583685cfee1eea3f6a642189b541da170b

Author: Steven Bambling <smbambling at gmail.com>
Date:   Tue Nov  4 12:26:09 2014 -0500

adding methods attribute and allowing settable import template

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

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

refs#7217: https://dev.icinga.org/issues/7217

---

 manifests/object/timeperiod.pp |   23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/manifests/object/timeperiod.pp b/manifests/object/timeperiod.pp
index 8d63a41..e345306 100644
--- a/manifests/object/timeperiod.pp
+++ b/manifests/object/timeperiod.pp
@@ -10,19 +10,25 @@
 #
 
 define icinga2::object::timeperiod (
-  $object_timeperiod_name       = $name,
-  $timeperiod_display_name      = undef,
-  $timeperiod_ranges            = {},
-  $timeperiod_target_dir        = '/etc/icinga2/objects/timeperiods',
-  $timeperiod_target_file_name  = "${name}.conf",
-  $timeperiod_target_file_owner = 'root',
-  $timeperiod_target_file_group = 'root',
-  $timeperiod_target_file_mode  = '0644',
+  $object_timeperiod_name        = $name,
+  $timeperiod_template_to_import = 'legacy-timeperiod',
+  $timeperiod_display_name       = undef,
+  $timeperiod_methods                       = undef,
+  $timeperiod_ranges             = {},
+  $timeperiod_target_dir         = '/etc/icinga2/objects/timeperiods',
+  $timeperiod_target_file_name   = "${name}.conf",
+  $timeperiod_target_file_owner  = 'root',
+  $timeperiod_target_file_group  = 'root',
+  $timeperiod_target_file_mode   = '0644',
 ) {
 
   # Do some validation of the class' parameters:
   validate_string($object_timeperiod_name)
+  validate_string($timeperiod_template_to_import)
   validate_string($timeperiod_display_name)
+  if $timeperiod_methods {
+    validate_string($timeperiod_methods)
+  }
   validate_hash($timeperiod_ranges)
   validate_string($timeperiod_target_dir)
   validate_string($timeperiod_target_file_name)
@@ -38,5 +44,4 @@ define icinga2::object::timeperiod (
     content => template('icinga2/object_timeperiod.conf.erb'),
     notify  => Service['icinga2'],
   }
-  
 }



More information about the icinga-checkins mailing list