Fix Ironic dbsync ordering
authorDmitry Tantsur <divius.inside@gmail.com>
Wed, 20 Jul 2016 10:05:51 +0000 (12:05 +0200)
committerDmitry Tantsur <divius.inside@gmail.com>
Wed, 20 Jul 2016 10:05:51 +0000 (12:05 +0200)
Including ::ironic runs ironic-dbsync by default, so we end up with
ironic-dbsync run before the database is created. This patch fixes it.

Change-Id: I6fef1de18e52b68caaf4cbd55c0408b98b5c26e0
Partially-Implements: blueprint ironic-integration

manifests/profile/base/ironic.pp

index dd30dd7..ca4f366 100644 (file)
@@ -30,19 +30,20 @@ class tripleo::profile::base::ironic (
   $bootstrap_node = hiera('bootstrap_nodeid', undef),
   $step           = hiera('step'),
 ) {
+  # Database is accessed by both API and conductor, hence it's here.
   if $::hostname == downcase($bootstrap_node) {
     $sync_db = true
   } else {
     $sync_db = false
   }
 
-  if $step >= 3 {
-    include ::ironic
+  if $step >= 3 and $sync_db {
+    include ::ironic::db::mysql
+  }
 
-    # Database is accessed by both API and conductor, hence it's here.
-    if $sync_db {
-      include ::ironic::db::mysql
-      include ::ironic::db::sync
+  if $step >= 4 or ($step >= 3 and $sync_db) {
+    class { '::ironic':
+      sync_db => $sync_db,
     }
   }
 }