puppet-glance/manifests/db/mysql.pp

37 lines
836 B
Puppet

#
# I should change this to mysql
# for consistency
#
class glance::db::mysql(
$password,
$dbname = 'glance',
$user = 'glance',
$host = '127.0.0.1',
$allowed_hosts = undef,
$cluster_id = 'localzone'
) {
Class['glance::db::mysql'] -> Exec<| title == 'glance-manage db_sync' |>
Database[$dbname] ~> Exec<| title == 'glance-manage db_sync' |>
require 'mysql::python'
mysql::db { $dbname:
user => $user,
password => $password,
host => $host,
charset => 'latin1',
# I may want to inject some sql
require => Class['mysql::server'],
}
if $allowed_hosts {
# TODO this class should be in the mysql namespace
glance::db::mysql::host_access { $allowed_hosts:
user => $user,
password => $password,
database => $dbname,
}
}
}