Move mysql code to db::mysql

This commit moves the mysql specific db manifests
to the namespace glance::db::mysql.

This is done for two reasons:
  - to create a directory loaction for manifests
    for all future supported datbases
  - to be consistent with other openstack projects
This commit is contained in:
Dan Bode 2012-04-22 23:51:48 -07:00
parent 827b302824
commit 52aae65a4c
4 changed files with 11 additions and 7 deletions

View File

@ -40,7 +40,7 @@ node glance_keystone_mysql {
log_debug => true,
catalog_type => 'sql',
}->
class { 'keystone::mysql':
class { 'keystone::db::mysql':
password => 'keystone',
}->
class { 'keystone::roles::admin': }
@ -90,7 +90,7 @@ class role_glance_mysql {
}
class { 'glance::backend::file': }
class { 'glance::db':
class { 'glance::db::mysql':
password => 'glance',
dbname => 'glance',
user => 'glance',

View File

@ -11,10 +11,12 @@ define glance::api::config(
$content = template("glance/api/${name}.erb"),
$order = undef
) {
concat::fragment { "glance-api-${name}":
target => '/etc/glance/glance-api.conf',
content => $content,
order => $order,
}
}

View File

@ -2,7 +2,7 @@
# I should change this to mysql
# for consistency
#
class glance::db(
class glance::db::mysql(
$password,
$dbname = 'glance',
$user = 'glance',
@ -11,7 +11,7 @@ class glance::db(
$cluster_id = 'localzone'
) {
Class['glance::db'] -> Exec<| title == 'glance-manage db_sync' |>
Class['glance::db::mysql'] -> Exec<| title == 'glance-manage db_sync' |>
Database[$dbname] ~> Exec<| title == 'glance-manage db_sync' |>
require 'mysql::python'
@ -27,7 +27,7 @@ class glance::db(
if $allowed_hosts {
# TODO this class should be in the mysql namespace
glance::db::host_access { $allowed_hosts:
glance::db::mysql::host_access { $allowed_hosts:
user => $user,
password => $password,
database => $dbname,

View File

@ -1,5 +1,7 @@
# db/allowed_hosts.pp
define glance::db::host_access ($user, $password, $database) {
#
# Used to grant access to the glance mysql DB
#
define glance::db::mysql::host_access ($user, $password, $database) {
database_user { "${user}@${name}":
password_hash => mysql_password($password),
provider => 'mysql',