puppet: only enable Ntp if ntp::servers is set
authorDan Prince <dprince@redhat.com>
Fri, 6 Feb 2015 13:42:59 +0000 (08:42 -0500)
committerDan Prince <dprince@redhat.com>
Fri, 6 Feb 2015 13:42:59 +0000 (08:42 -0500)
Not all installations have an NtpServer configured and if
they don't the ntp service will fail to startup correctly.

This patch makes it so that ntp is only enabled if
the ntp::servers array is greater than 0.

Change-Id: I8417f87ad2a3c1237ebb00ee1232b5313cd45d46

puppet/overcloud_compute.pp
puppet/overcloud_controller.pp
puppet/overcloud_object.pp
puppet/overcloud_volume.pp

index 2ff31be..0d2790b 100644 (file)
@@ -24,7 +24,9 @@ if !str2bool(hiera('enable_package_install', 'false')) {
   }
 }
 
-include ::ntp
+if count(hiera('ntp::servers')) > 0 {
+  include ::ntp
+}
 
 class { 'nova':
   glance_api_servers => join([hiera('glance_protocol'), '://', hiera('glance_host'), ':', hiera('glance_port')]),
index 5927e2f..4801107 100644 (file)
@@ -26,7 +26,9 @@ if !str2bool(hiera('enable_package_install', 'false')) {
 
 if hiera('step') >= 1 {
 
-  include ::ntp
+  if count(hiera('ntp::servers')) > 0 {
+    include ::ntp
+  }
 
   # TODO Galara
   class { 'mysql::server':
index c407afa..8d0ad78 100644 (file)
@@ -23,7 +23,10 @@ if !str2bool(hiera('enable_package_install', 'false')) {
     }
   }
 }
-include ::ntp
+
+if count(hiera('ntp::servers')) > 0 {
+  include ::ntp
+}
 
 include ::swift
 class {'swift::storage::all':
index 9351d70..b433321 100644 (file)
@@ -24,7 +24,9 @@ if str2bool(hiera('disable_package_install', 'false')) {
   }
 }
 
-include ::ntp
+if count(hiera('ntp::servers')) > 0 {
+  include ::ntp
+}
 
 include ::cinder
 include ::cinder::volume