Make neutron server/ml2 profiles match t-h-t
authorDan Prince <dprince@redhat.com>
Mon, 6 Jun 2016 19:48:29 +0000 (15:48 -0400)
committerDan Prince <dprince@redhat.com>
Thu, 9 Jun 2016 14:43:31 +0000 (10:43 -0400)
This patch brings the neutron profiles and the
associated steps in line with what already happens in
t-h-t. Specifically:

 -we want to create the db $step >= 2 and $sync_db
 -we want to make sure plugin.ini exists before the neutron dbsync
 -we want to make sure the db sync runs before neutron::server starts
  when using pacemaker
 -split the neutron server profiles. They are quite different across
  pacemaker and base.

Change-Id: I52815f45a04bf3e39940b9cb116261730580a3e2

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

index 47b1b3c..d18638e 100644 (file)
 #   (Optional) The mechanism drivers to use with the Ml2 plugin
 #   Defaults to hiera('neutron::plugins::ml2::mechanism_drivers')
 #
+# [*sync_db*]
+# (Optional) Whether to run Neutron DB sync operations
+# Defaults to undef
+#
 # [*step*]
 #   (Optional) The current step in deployment. See tripleo-heat-templates
 #   for more details.
 #
 class tripleo::profile::base::neutron::ml2 (
   $mechanism_drivers  = hiera('neutron::plugins::ml2::mechanism_drivers'),
+  $sync_db            = true,
   $step               = hiera('step'),
 ) {
 
-  if $step >= 4 {
+  if $step >= 4 or ( $step >= 3 and $sync_db ) {
     include ::neutron::plugins::ml2
     include ::tripleo::profile::base::neutron
 
index 14af56e..320f83c 100644 (file)
 #
 # === Parameters
 #
-# [*sync_db*]
-#   (Optional) Whether to run Neutron DB sync operations
-#   Defaults to undef
-#
 # [*step*]
 #   (Optional) The current step in deployment. See tripleo-heat-templates
 #   for more details.
 #   Defaults to hiera('step')
 #
 class tripleo::profile::base::neutron::server (
-  $sync_db          = true,
   $step             = hiera('step'),
 ) {
 
   include ::tripleo::profile::base::neutron
 
-  if $step >= 3 and $sync_db {
+  if $step >= 2 {
     include ::neutron::db::mysql
   }
 
-  if $step >= 4 or ($step >=3 and $sync_db) {
+  if $step >= 4 {
     include ::neutron::server::notifications
-
-    class { '::neutron::server':
-      sync_db        => $sync_db,
-    }
+    include ::neutron::server
   }
+
 }
index 6c6e580..8acaf21 100644 (file)
 #
 # === Parameters
 #
-class tripleo::profile::pacemaker::neutron::ml2 {
+# [*pacemaker_master*]
+#   (Optional) The hostname of the pacemaker master
+#   Defaults to hiera('bootstrap_nodeid')
+#
+class tripleo::profile::pacemaker::neutron::ml2 (
+  $pacemaker_master = hiera('bootstrap_nodeid'),
+) {
+
   include ::neutron::params
   include ::tripleo::profile::pacemaker::neutron
-  include ::tripleo::profile::base::neutron::ml2
+
+  class { '::tripleo::profile::base::neutron::ml2':
+    sync_db => ($::hostname == downcase($pacemaker_master))
+  }
+
 }
index f4fe083..fa00b3e 100644 (file)
 #   Defaults to hiera('bootstrap_nodeid')
 #
 # [*step*]
-#   (Optional) The current step in deployment. See tripleo-heat-templates
-#   for more details.
-#   Defaults to hiera('step')
+#  (Optional) The current step in deployment. See tripleo-heat-templates
+#  for more details.
+#  Defaults to hiera('step')
 #
 class tripleo::profile::pacemaker::neutron::server (
   $pacemaker_master = hiera('bootstrap_nodeid'),
-  $step = hiera('step'),
+  $step             = hiera('step'),
 ) {
+
   include ::neutron::params
   include ::tripleo::profile::pacemaker::neutron
 
-  if $step >= 5 {
-    class { '::tripleo::profile::base::neutron::server':
-      sync_db        => ($::hostname == downcase($pacemaker_master)),
-    }
+  if $step >= 2 {
+    include ::neutron::db::mysql
+    Exec<| title == 'galera-ready'|> -> Class['neutron::db::mysql']
+  }
+
+  $sync_db = ($::hostname == downcase($pacemaker_master))
+  if $step >= 4 or ( $step >= 3 and $sync_db ) {
+    include ::neutron::server::notifications
+    include ::neutron::server
   }
 
 }