aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-09-28 09:29:57 +0000
committerGerrit Code Review <review@openstack.org>2016-09-28 09:29:57 +0000
commit7ac0d1c76a27b790bb0f1ce6255ba73d13f0bf73 (patch)
tree1f396f1a0191411332222b21ee6dc83448023259
parent44ad407272f8d0703a95411311b9cff04d5b00b2 (diff)
parentd6712e45e3db06b354a9f6ee46e237d5c40caff6 (diff)
Merge "Move db syncs into mysql base role"
-rw-r--r--manifests/profile/base/aodh.pp4
-rw-r--r--manifests/profile/base/ceilometer/collector.pp4
-rw-r--r--manifests/profile/base/cinder/api.pp4
-rw-r--r--manifests/profile/base/database/mysql.pp58
-rw-r--r--manifests/profile/base/glance/registry.pp4
-rw-r--r--manifests/profile/base/gnocchi/api.pp1
-rw-r--r--manifests/profile/base/heat/engine.pp4
-rw-r--r--manifests/profile/base/ironic.pp4
-rw-r--r--manifests/profile/base/keystone.pp4
-rw-r--r--manifests/profile/base/manila/api.pp4
-rw-r--r--manifests/profile/base/mistral.pp4
-rw-r--r--manifests/profile/base/neutron/server.pp4
-rw-r--r--manifests/profile/base/nova/api.pp5
-rw-r--r--manifests/profile/base/sahara/engine.pp4
-rw-r--r--manifests/profile/base/trove/api.pp4
-rw-r--r--manifests/profile/pacemaker/database/mysql.pp5
16 files changed, 63 insertions, 54 deletions
diff --git a/manifests/profile/base/aodh.pp b/manifests/profile/base/aodh.pp
index 2fad5b3..49a543a 100644
--- a/manifests/profile/base/aodh.pp
+++ b/manifests/profile/base/aodh.pp
@@ -44,10 +44,6 @@ class tripleo::profile::base::aodh (
$sync_db = false
}
- if $step >= 3 and $sync_db {
- include ::aodh::db::mysql
- }
-
if $step >= 4 or ($step >= 3 and $sync_db) {
class { '::aodh' :
rabbit_hosts => $rabbit_hosts,
diff --git a/manifests/profile/base/ceilometer/collector.pp b/manifests/profile/base/ceilometer/collector.pp
index baaf4c8..e892478 100644
--- a/manifests/profile/base/ceilometer/collector.pp
+++ b/manifests/profile/base/ceilometer/collector.pp
@@ -59,10 +59,6 @@ class tripleo::profile::base::ceilometer::collector (
include ::tripleo::profile::base::ceilometer
- if $step >= 2 and $sync_db and $ceilometer_backend == 'mysql' {
- include ::ceilometer::db::mysql
- }
-
if $step >= 3 and $sync_db {
include ::ceilometer::db::sync
}
diff --git a/manifests/profile/base/cinder/api.pp b/manifests/profile/base/cinder/api.pp
index 370b402..31635eb 100644
--- a/manifests/profile/base/cinder/api.pp
+++ b/manifests/profile/base/cinder/api.pp
@@ -39,10 +39,6 @@ class tripleo::profile::base::cinder::api (
include ::tripleo::profile::base::cinder
- if $step >= 3 and $sync_db {
- include ::cinder::db::mysql
- }
-
if $step >= 4 or ($step >= 3 and $sync_db) {
include ::cinder::api
include ::cinder::ceilometer
diff --git a/manifests/profile/base/database/mysql.pp b/manifests/profile/base/database/mysql.pp
index 31a90ec..9da1456 100644
--- a/manifests/profile/base/database/mysql.pp
+++ b/manifests/profile/base/database/mysql.pp
@@ -22,6 +22,10 @@
# (Optional) The address that the local mysql instance should bind to.
# Defaults to $::hostname
#
+# [*bootstrap_node*]
+# (Optional) The hostname of the node responsible for bootstrapping tasks
+# Defaults to hiera('bootstrap_nodeid')
+#
# [*manage_resources*]
# (Optional) Whether or not manage root user, root my.cnf, and service.
# Defaults to true
@@ -42,12 +46,19 @@
#
class tripleo::profile::base::database::mysql (
$bind_address = $::hostname,
+ $bootstrap_node = hiera('bootstrap_nodeid', undef),
$manage_resources = true,
$mysql_server_options = {},
$remove_default_accounts = true,
$step = hiera('step'),
) {
+ if $::hostname == downcase($bootstrap_node) {
+ $sync_db = true
+ } else {
+ $sync_db = false
+ }
+
validate_hash($mysql_server_options)
# non-ha scenario
@@ -87,4 +98,51 @@ class tripleo::profile::base::database::mysql (
}
}
+ if $step >= 2 and $sync_db {
+ Class['::mysql::server'] -> Mysql_database<||>
+ if hiera('aodh_api_enabled', false) {
+ include ::aodh::db::mysql
+ }
+ if hiera('ceilometer_collector_enabled', false) {
+ include ::ceilometer::db::mysql
+ }
+ if hiera('cinder_api_enabled', false) {
+ include ::cinder::db::mysql
+ }
+ if hiera('glance_registry_enabled', false) {
+ include ::glance::db::mysql
+ }
+ if hiera('gnocchi_api_enabled', false) {
+ include ::gnocchi::db::mysql
+ }
+ if hiera('heat_engine_enabled', false) {
+ include ::heat::db::mysql
+ }
+ if hiera('ironic_api_enabled', false) {
+ include ::ironic::db::mysql
+ }
+ if hiera('keystone_enabled', false) {
+ include ::keystone::db::mysql
+ }
+ if hiera('manila_api_enabled', false) {
+ include ::manila::db::mysql
+ }
+ if hiera('mistral_api_enabled', false) {
+ include ::mistral::db::mysql
+ }
+ if hiera('neutron_api_enabled', false) {
+ include ::neutron::db::mysql
+ }
+ if hiera('nova_api_enabled', false) {
+ include ::nova::db::mysql
+ include ::nova::db::mysql_api
+ }
+ if hiera('sahara_api_enabled', false) {
+ include ::sahara::db::mysql
+ }
+ if hiera('trove_api_enabled', false) {
+ include ::trove::db::mysql
+ }
+ }
+
}
diff --git a/manifests/profile/base/glance/registry.pp b/manifests/profile/base/glance/registry.pp
index ac6796a..9e2be9d 100644
--- a/manifests/profile/base/glance/registry.pp
+++ b/manifests/profile/base/glance/registry.pp
@@ -42,10 +42,6 @@ class tripleo::profile::base::glance::registry (
$sync_db = false
}
- if $step >= 3 and $sync_db {
- include ::glance::db::mysql
- }
-
if $step >= 4 or ( $step >= 3 and $sync_db ) {
# TODO: notifications, scrubber, etc.
include ::glance
diff --git a/manifests/profile/base/gnocchi/api.pp b/manifests/profile/base/gnocchi/api.pp
index 5e7e215..732ea26 100644
--- a/manifests/profile/base/gnocchi/api.pp
+++ b/manifests/profile/base/gnocchi/api.pp
@@ -45,7 +45,6 @@ class tripleo::profile::base::gnocchi::api (
include ::tripleo::profile::base::gnocchi
if $step >= 3 and $sync_db {
- include ::gnocchi::db::mysql
include ::gnocchi::db::sync
}
diff --git a/manifests/profile/base/heat/engine.pp b/manifests/profile/base/heat/engine.pp
index 112fad8..479e1c6 100644
--- a/manifests/profile/base/heat/engine.pp
+++ b/manifests/profile/base/heat/engine.pp
@@ -39,10 +39,6 @@ class tripleo::profile::base::heat::engine (
include ::tripleo::profile::base::heat
- if $step >= 3 and $sync_db {
- include ::heat::db::mysql
- }
-
if $step >= 4 or ( $step >= 3 and $sync_db ) {
include ::heat::engine
}
diff --git a/manifests/profile/base/ironic.pp b/manifests/profile/base/ironic.pp
index 6c0769a..c4e525a 100644
--- a/manifests/profile/base/ironic.pp
+++ b/manifests/profile/base/ironic.pp
@@ -42,10 +42,6 @@ class tripleo::profile::base::ironic (
$sync_db = false
}
- if $step >= 3 and $sync_db {
- include ::ironic::db::mysql
- }
-
if $step >= 4 or ($step >= 3 and $sync_db) {
class { '::ironic':
sync_db => $sync_db,
diff --git a/manifests/profile/base/keystone.pp b/manifests/profile/base/keystone.pp
index fd38869..d515f8f 100644
--- a/manifests/profile/base/keystone.pp
+++ b/manifests/profile/base/keystone.pp
@@ -51,10 +51,6 @@ class tripleo::profile::base::keystone (
$manage_endpoint = false
}
- if $step >= 3 and $sync_db {
- include ::keystone::db::mysql
- }
-
if $step >= 4 or ( $step >= 3 and $sync_db ) {
class { '::keystone':
sync_db => $sync_db,
diff --git a/manifests/profile/base/manila/api.pp b/manifests/profile/base/manila/api.pp
index ca5455f..1f78ab3 100644
--- a/manifests/profile/base/manila/api.pp
+++ b/manifests/profile/base/manila/api.pp
@@ -39,10 +39,6 @@ class tripleo::profile::base::manila::api (
include ::tripleo::profile::base::manila
- if $step >= 3 and $sync_db {
- include ::manila::db::mysql
- }
-
if $step >= 4 or ($step >= 3 and $sync_db) {
include ::manila::api
}
diff --git a/manifests/profile/base/mistral.pp b/manifests/profile/base/mistral.pp
index 3ebc3d5..9986d22 100644
--- a/manifests/profile/base/mistral.pp
+++ b/manifests/profile/base/mistral.pp
@@ -42,10 +42,6 @@ class tripleo::profile::base::mistral (
$sync_db = false
}
- if $step >= 3 and $sync_db {
- include ::mistral::db::mysql
- }
-
if $step >= 4 or ($step >= 3 and $sync_db) {
class { '::mistral':
rabbit_hosts => $rabbit_hosts,
diff --git a/manifests/profile/base/neutron/server.pp b/manifests/profile/base/neutron/server.pp
index 5a1b377..82c2d5f 100644
--- a/manifests/profile/base/neutron/server.pp
+++ b/manifests/profile/base/neutron/server.pp
@@ -39,10 +39,6 @@ class tripleo::profile::base::neutron::server (
include ::tripleo::profile::base::neutron
- if $step >= 3 and $sync_db {
- include ::neutron::db::mysql
- }
-
# We start neutron-server on the bootstrap node first, because
# it will try to populate tables and we need to make sure this happens
# before it starts on other nodes
diff --git a/manifests/profile/base/nova/api.pp b/manifests/profile/base/nova/api.pp
index 285e0b7..3c472c5 100644
--- a/manifests/profile/base/nova/api.pp
+++ b/manifests/profile/base/nova/api.pp
@@ -37,11 +37,6 @@ class tripleo::profile::base::nova::api (
include ::tripleo::profile::base::nova
- if $step >= 3 and $sync_db {
- include ::nova::db::mysql
- include ::nova::db::mysql_api
- }
-
if $step >= 4 or ($step >= 3 and $sync_db) {
class { '::nova::api':
sync_db => $sync_db,
diff --git a/manifests/profile/base/sahara/engine.pp b/manifests/profile/base/sahara/engine.pp
index 4dbaa85..e2da0e7 100644
--- a/manifests/profile/base/sahara/engine.pp
+++ b/manifests/profile/base/sahara/engine.pp
@@ -39,10 +39,6 @@ class tripleo::profile::base::sahara::engine (
include ::tripleo::profile::base::sahara
- if $step >= 3 and $sync_db {
- include ::sahara::db::mysql
- }
-
if $step >= 4 or ($step >= 3 and $sync_db) {
include ::sahara::service::engine
}
diff --git a/manifests/profile/base/trove/api.pp b/manifests/profile/base/trove/api.pp
index 7a78171..bc16e6e 100644
--- a/manifests/profile/base/trove/api.pp
+++ b/manifests/profile/base/trove/api.pp
@@ -37,10 +37,6 @@ class tripleo::profile::base::trove::api (
$sync_db = false
}
- if $step >= 3 and $sync_db {
- include ::trove::db::mysql
- }
-
if $step >= 4 or ($step >= 3 and $sync_db) {
include ::trove
include ::trove::config
diff --git a/manifests/profile/pacemaker/database/mysql.pp b/manifests/profile/pacemaker/database/mysql.pp
index 477d17c..0169e16 100644
--- a/manifests/profile/pacemaker/database/mysql.pp
+++ b/manifests/profile/pacemaker/database/mysql.pp
@@ -130,6 +130,11 @@ class tripleo::profile::pacemaker::database::mysql (
table => '*.*',
user => 'clustercheck@localhost',
}
+
+ # We create databases for services at step 2 as well. This ensures
+ # Galara is up before those get created
+ Exec['galera-ready'] -> Mysql_database<||>
+
}
# This step is to create a sysconfig clustercheck file with the root user and empty password
# on the first install only (because later on the clustercheck db user will be used)