Directly create the baremetal test database.

mysql::db assumes it has to create the user given to it each time it is
invoked. This break when you want to give one user access to mulitple
DBs. To work around this directly create the new DB and grant
permissions to it using the types provided by the puppetlabs-mysql
module. This change was made copying what mysql::db does[1].

[1] https://github.com/puppetlabs/puppetlabs-mysql/blob/0.5.0/manifests/db.pp

Change-Id: Ie45c1bd6f276bfbbc776e816cb5957a7fe808882
Reviewed-on: https://review.openstack.org/22393
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
This commit is contained in:
Clark Boylan
2013-02-19 19:47:06 -08:00
committed by Jenkins
parent 130425ada1
commit c7ddd493cd

View File

@@ -175,17 +175,26 @@ class jenkins::slave(
],
}
mysql::db { 'openstack_baremetal_citest':
user => 'openstack_citest',
password => 'openstack_citest',
host => 'localhost',
grant => ['all'],
# mysql::db is too dumb to realize that the same user can have
# access to multiple databases and will fail if you try creating
# a second DB with the same user. Create the DB directly as mysql::db
# above is creating the user for us.
database { 'openstack_baremetal_citest':
ensure => present,
charset => 'utf8',
provider => 'mysql',
require => [
Class['mysql::server'],
Class['mysql::server::account_security'],
],
}
database_grant { 'openstack_citest@localhost/openstack_baremetal_citest':
privileges => ['all'],
provider => 'mysql',
require => Database_user['openstack_citest@localhost'],
}
$no_postgresql_version = 'Unsupported OS! Please check `postgres_default_version` fact.'
if $::postgres_default_version == $no_postgresql_version {
# Have a default postgres version if the postgresql module can't decide