Include neutron in step 3
authorJuan Antonio Osorio Robles <jaosorior@redhat.com>
Mon, 6 Jun 2016 07:05:31 +0000 (10:05 +0300)
committerDan Prince <dprince@redhat.com>
Tue, 7 Jun 2016 18:08:37 +0000 (14:08 -0400)
neutron::server requires the neutron's init.pp to be ran beforehand
because init.pp installs the 'neutron' package. Else the relationship
with neutron::policy will fail [1].So to address this, we move
neutron's init.pp to be ran on step 3 if db_sync is enabled.

[1] https://github.com/openstack/puppet-neutron/blob/master/manifests/server.pp#L498

Change-Id: I8eb497c2b483e11d1f640a7ba9fae5a9d5bcef4d

manifests/profile/base/neutron.pp
manifests/profile/pacemaker/neutron.pp

index 2958170..d5efa81 100644 (file)
 #
 # === Parameters
 #
+# [*sync_db*]
+#   (Optional) Whether to run db sync
+#   Defaults to true
+#
 # [*step*]
 #   (Optional) The current step of the deployment
 #   Defaults to hiera('step')
 #
 class tripleo::profile::base::neutron (
-  $step = hiera('step'),
+  $sync_db = true,
+  $step    = hiera('step'),
 ) {
-  if $step >= 4 {
+  if hiera('step') >= 4 or ( hiera('step') >= 3 and $sync_db ) {
     include ::neutron
     include ::neutron::config
   }
index 03ccbc3..2af53dc 100644 (file)
@@ -61,9 +61,12 @@ class tripleo::profile::pacemaker::neutron (
     stop       => '/bin/true',
   }
 
+  class { '::tripleo::profile::base::neutron':
+    sync_db => ($::hostname == downcase($pacemaker_master)),
+  }
+
   if $step >= 4 {
     include ::neutron::params
-    include ::tripleo::profile::base::neutron
 
     # To be removed when puppet-oslo comes into service
     neutron_config {