
Global replacement of all Quantum references with Neutron. Change-Id: I74ad15e382589ced6f47d0783e3e952627fcd0f7
37 lines
924 B
Puppet
37 lines
924 B
Puppet
#
|
|
class neutron::db::mysql (
|
|
$password,
|
|
$dbname = 'neutron',
|
|
$user = 'neutron',
|
|
$host = '127.0.0.1',
|
|
$allowed_hosts = undef,
|
|
$charset = 'latin1',
|
|
$cluster_id = 'localzone'
|
|
) {
|
|
|
|
require mysql::python
|
|
|
|
mysql::db { $dbname:
|
|
user => $user,
|
|
password => $password,
|
|
host => $host,
|
|
charset => $charset,
|
|
require => Class['mysql::config'],
|
|
}
|
|
|
|
# Check allowed_hosts to avoid duplicate resource declarations
|
|
if is_array($allowed_hosts) and delete($allowed_hosts,$host) != [] {
|
|
$real_allowed_hosts = delete($allowed_hosts,$host)
|
|
} elsif is_string($allowed_hosts) and ($allowed_hosts != $host) {
|
|
$real_allowed_hosts = $allowed_hosts
|
|
}
|
|
|
|
if $real_allowed_hosts {
|
|
neutron::db::mysql::host_access { $real_allowed_hosts:
|
|
user => $user,
|
|
password => $password,
|
|
database => $dbname,
|
|
}
|
|
}
|
|
}
|