[icinga-checkins] icinga.org: chef-icinga2/master: setup pki env zone endpoint resources if node[icinga2][enable_env_pki] is enabled

git at icinga.org git at icinga.org
Sat Jul 16 19:49:37 CEST 2016


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

Author: Virender Khatri <vir.khatri at gmail.com>
Date:   Sat Jul 16 23:34:51 2016 +0530

setup pki env zone endpoint resources if node[icinga2][enable_env_pki] is enabled

---

 attributes/default.rb             |    1 +
 libraries/provider_environment.rb |    8 +++++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/attributes/default.rb b/attributes/default.rb
index d555c09..d1104c1 100644
--- a/attributes/default.rb
+++ b/attributes/default.rb
@@ -2,6 +2,7 @@
 
 default['icinga2']['version'] = '2.4.1-1'
 
+default['icinga2']['enable_env_pki'] = false
 default['icinga2']['ignore_version'] = false
 default['icinga2']['cookbook'] = 'icinga2'
 default['icinga2']['conf_dir'] = '/etc/icinga2'
diff --git a/libraries/provider_environment.rb b/libraries/provider_environment.rb
index 2b6e275..b1f42ba 100644
--- a/libraries/provider_environment.rb
+++ b/libraries/provider_environment.rb
@@ -116,9 +116,11 @@ class Chef
           notifies :reload, 'service[icinga2]'
         end
         return true if hosts_template.updated? || create_hostgroups(env_resources)
-        return true if hosts_template.updated? || create_endpoints(env_resources)
-        return true if hosts_template.updated? || create_zones(env_resources)
-        return true if hosts_template.updated? || create_pki_tickets(env_resources)
+        if node['icinga2']['enable_env_pki']
+          return true if hosts_template.updated? || create_endpoints(env_resources)
+          return true if hosts_template.updated? || create_zones(env_resources)
+          return true if hosts_template.updated? || create_pki_tickets(env_resources)
+        end
       end
 
       def create_hostgroups(env_resources)



More information about the icinga-checkins mailing list