Files
puppet-nova/manifests/db/mysql.pp
Michael Chapman 6a358c0e9d Make parameter doc RDoc compatible
This patch fixes all remaining parameter documentation
in the nova module to be compatible with puppet-doc
and documents all parameters in a standard way.

Change-Id: I451078d46cb2498dd8e3c23bd8cbcc81b8845fcd
2013-12-16 16:07:10 +11:00

72 lines
1.7 KiB
Puppet

# == Class: nova::db::mysql
#
# Class that configures mysql for nova
#
# === Parameters:
#
# [*password*]
# Password to use for the nova user
#
# [*dbname*]
# (optional) The name of the database
# Defaults to 'nova'
#
# [*user*]
# (optional) The mysql user to create
# Defaults to 'nova'
#
# [*host*]
# (optional) The IP address of the mysql server
# Defaults to '127.0.0.1'
#
# [*charset*]
# (optional) The chaset to use for the nova database
# Defaults to 'latin1'
#
# [*allowed_hosts*]
# (optional) Additional hosts that are allowed to access this DB
# Defaults to undef
#
# [*cluster_id*]
# (optional) Deprecated. Does nothing
# Defaults to 'localzone'
#
class nova::db::mysql(
$password,
$dbname = 'nova',
$user = 'nova',
$host = '127.0.0.1',
$charset = 'latin1',
$allowed_hosts = undef,
$cluster_id = 'localzone'
) {
require 'mysql::python'
# Create the db instance before openstack-nova if its installed
Mysql::Db[$dbname] -> Anchor<| title == 'nova-start' |>
Mysql::Db[$dbname] ~> Exec<| title == 'nova-db-sync' |>
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 {
nova::db::mysql::host_access { $real_allowed_hosts:
user => $user,
password => $password,
database => $dbname,
}
}
}