summaryrefslogtreecommitdiffstats
path: root/puppet/manifests
diff options
context:
space:
mode:
authorDan Prince <dprince@redhat.com>2015-07-20 07:56:26 -0400
committerDan Prince <dprince@redhat.com>2015-07-21 08:36:39 -0400
commitffa69110969d79c222a57d71da4d9dcf6fa22b3f (patch)
tree76aebd894c8889f84885230c86c21cfbaff4a012 /puppet/manifests
parent7fc1f4df89019d2771d5d055a99d02ad3373e6b9 (diff)
Drive DB initialization via Hiera
This patch moves most of the ::db::mysql parameter initialization into a new database.yaml Hiera file. This cleans up the controller manifests and allows us to define things in a single location across the two implementations (HA and nonHA). Change-Id: I895b753b329097a96a6c6f3a03a5fcebefe32dd4
Diffstat (limited to 'puppet/manifests')
-rw-r--r--puppet/manifests/overcloud_controller.pp65
-rw-r--r--puppet/manifests/overcloud_controller_pacemaker.pp45
2 files changed, 8 insertions, 102 deletions
diff --git a/puppet/manifests/overcloud_controller.pp b/puppet/manifests/overcloud_controller.pp
index c9ff86c6..0b23a632 100644
--- a/puppet/manifests/overcloud_controller.pp
+++ b/puppet/manifests/overcloud_controller.pp
@@ -89,65 +89,14 @@ if hiera('step') >= 2 {
# FIXME: this should only occur on the bootstrap host (ditto for db syncs)
# Create all the database schemas
- # Example DSN format: mysql://user:password@host/dbname
- $allowed_hosts = ['%',hiera('mysql_bind_host')]
- $keystone_dsn = split(hiera('keystone::database_connection'), '[@:/?]')
- class { 'keystone::db::mysql':
- user => $keystone_dsn[3],
- password => $keystone_dsn[4],
- host => $keystone_dsn[5],
- dbname => $keystone_dsn[6],
- allowed_hosts => $allowed_hosts,
- }
- $glance_dsn = split(hiera('glance::api::database_connection'), '[@:/?]')
- class { 'glance::db::mysql':
- user => $glance_dsn[3],
- password => $glance_dsn[4],
- host => $glance_dsn[5],
- dbname => $glance_dsn[6],
- allowed_hosts => $allowed_hosts,
- }
- $nova_dsn = split(hiera('nova::database_connection'), '[@:/?]')
- class { 'nova::db::mysql':
- user => $nova_dsn[3],
- password => $nova_dsn[4],
- host => $nova_dsn[5],
- dbname => $nova_dsn[6],
- allowed_hosts => $allowed_hosts,
- }
- $neutron_dsn = split(hiera('neutron::server::database_connection'), '[@:/?]')
- class { 'neutron::db::mysql':
- user => $neutron_dsn[3],
- password => $neutron_dsn[4],
- host => $neutron_dsn[5],
- dbname => $neutron_dsn[6],
- allowed_hosts => $allowed_hosts,
- }
- $cinder_dsn = split(hiera('cinder::database_connection'), '[@:/?]')
- class { 'cinder::db::mysql':
- user => $cinder_dsn[3],
- password => $cinder_dsn[4],
- host => $cinder_dsn[5],
- dbname => $cinder_dsn[6],
- allowed_hosts => $allowed_hosts,
- }
- $heat_dsn = split(hiera('heat::database_connection'), '[@:/?]')
- class { 'heat::db::mysql':
- user => $heat_dsn[3],
- password => $heat_dsn[4],
- host => $heat_dsn[5],
- dbname => $heat_dsn[6],
- allowed_hosts => $allowed_hosts,
- }
+ include ::keystone::db::mysql
+ include ::glance::db::mysql
+ include ::nova::db::mysql
+ include ::neutron::db::mysql
+ include ::cinder::db::mysql
+ include ::heat::db::mysql
if downcase(hiera('ceilometer_backend')) == 'mysql' {
- $ceilometer_dsn = split(hiera('ceilometer_mysql_conn_string'), '[@:/?]')
- class { 'ceilometer::db::mysql':
- user => $ceilometer_dsn[3],
- password => $ceilometer_dsn[4],
- host => $ceilometer_dsn[5],
- dbname => $ceilometer_dsn[6],
- allowed_hosts => $allowed_hosts,
- }
+ include ::ceilometer::db::mysql
}
$rabbit_nodes = hiera('rabbit_node_ips')
diff --git a/puppet/manifests/overcloud_controller_pacemaker.pp b/puppet/manifests/overcloud_controller_pacemaker.pp
index 24a2f734..6a41d16d 100644
--- a/puppet/manifests/overcloud_controller_pacemaker.pp
+++ b/puppet/manifests/overcloud_controller_pacemaker.pp
@@ -400,71 +400,28 @@ MYSQL_HOST=localhost\n",
}
# Create all the database schemas
- # Example DSN format: mysql://user:password@host/dbname
if $sync_db {
- $allowed_hosts = ['%',hiera('mysql_bind_host')]
- $keystone_dsn = split(hiera('keystone::database_connection'), '[@:/?]')
class { 'keystone::db::mysql':
- user => $keystone_dsn[3],
- password => $keystone_dsn[4],
- host => $keystone_dsn[5],
- dbname => $keystone_dsn[6],
- allowed_hosts => $allowed_hosts,
require => Exec['galera-ready'],
}
- $glance_dsn = split(hiera('glance::api::database_connection'), '[@:/?]')
class { 'glance::db::mysql':
- user => $glance_dsn[3],
- password => $glance_dsn[4],
- host => $glance_dsn[5],
- dbname => $glance_dsn[6],
- allowed_hosts => $allowed_hosts,
require => Exec['galera-ready'],
}
- $nova_dsn = split(hiera('nova::database_connection'), '[@:/?]')
class { 'nova::db::mysql':
- user => $nova_dsn[3],
- password => $nova_dsn[4],
- host => $nova_dsn[5],
- dbname => $nova_dsn[6],
- allowed_hosts => $allowed_hosts,
require => Exec['galera-ready'],
}
- $neutron_dsn = split(hiera('neutron::server::database_connection'), '[@:/?]')
class { 'neutron::db::mysql':
- user => $neutron_dsn[3],
- password => $neutron_dsn[4],
- host => $neutron_dsn[5],
- dbname => $neutron_dsn[6],
- allowed_hosts => $allowed_hosts,
require => Exec['galera-ready'],
}
- $cinder_dsn = split(hiera('cinder::database_connection'), '[@:/?]')
class { 'cinder::db::mysql':
- user => $cinder_dsn[3],
- password => $cinder_dsn[4],
- host => $cinder_dsn[5],
- dbname => $cinder_dsn[6],
- allowed_hosts => $allowed_hosts,
require => Exec['galera-ready'],
}
- $heat_dsn = split(hiera('heat::database_connection'), '[@:/?]')
class { 'heat::db::mysql':
- user => $heat_dsn[3],
- password => $heat_dsn[4],
- host => $heat_dsn[5],
- dbname => $heat_dsn[6],
- allowed_hosts => $allowed_hosts,
require => Exec['galera-ready'],
}
+
if downcase(hiera('ceilometer_backend')) == 'mysql' {
- $ceilometer_dsn = split(hiera('ceilometer_mysql_conn_string'), '[@:/?]')
class { 'ceilometer::db::mysql':
- user => $ceilometer_dsn[3],
- password => $ceilometer_dsn[4],
- host => $ceilometer_dsn[5],
- dbname => $ceilometer_dsn[6],
- allowed_hosts => $allowed_hosts,
require => Exec['galera-ready'],
}
}