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

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


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

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

iBug #8384 fix for lwrp checkcommand

---

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

diff --git a/providers/checkcommand.rb b/providers/checkcommand.rb
index 969d17d..b83bbd5 100644
--- a/providers/checkcommand.rb
+++ b/providers/checkcommand.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)
@@ -52,18 +53,15 @@ def objects
                                        'arguments' => resource.send('arguments'),
                                        'custom_vars' => resource.send('custom_vars') }
   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