[icinga-checkins] icinga.org: chef-icinga2/master: iBug #8384 fix for lwrp applynotification

git at icinga.org git at icinga.org
Fri Feb 6 23:06:38 CET 2015


Module: chef-icinga2
Branch: master
Commit: 9866f2819d5314128fd62cf5992b5f89846917d9
URL:    https://git.icinga.org/?p=chef-icinga2.git;a=commit;h=9866f2819d5314128fd62cf5992b5f89846917d9

Author: Virender Khatri <vir.khatri at gmail.com>
Date:   Sat Feb  7 03:34:20 2015 +0530

iBug #8384 fix for lwrp applynotification

---

 providers/applynotification.rb |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/providers/applynotification.rb b/providers/applynotification.rb
index c430c27..87d8cb2 100644
--- a/providers/applynotification.rb
+++ b/providers/applynotification.rb
@@ -38,8 +38,9 @@ def object_resources
   end
 end
 
-# collect objects
-def objects
+# collect objects and create resource template
+def object_template
+  # collect objects
   icinga2_objects = {}
   object_resources.reduce({}) do |_hash, resource|
     next if resource.action != :create || icinga2_objects.key?(resource.name)
@@ -57,18 +58,15 @@ def objects
                                        'assign_where' => resource.send('assign_where'),
                                        'ignore_where' => resource.send('ignore_where') }
   end
-  icinga2_objects
-end
 
-# create object resource
-def object_template
+  # create object resource
   ot = template ::File.join(node['icinga2']['objects_dir'], "#{::File.basename(__FILE__, '.rb')}.conf") do
     source "object.#{::File.basename(__FILE__, '.rb')}.conf.erb"
     cookbook 'icinga2'
     owner node['icinga2']['user']
     group node['icinga2']['group']
     mode 0640
-    variables(:objects => objects)
+    variables(:objects => icinga2_objects)
     notifies :reload, 'service[icinga2]', :delayed
   end
   ot.updated?



More information about the icinga-checkins mailing list