Add charset option for db setting

This patch is aim to make openstack::db::mysql can
configure database charset, the default value is latin1.

Fixes bug #1231250

Change-Id: I4eedaacad6cce9f8ee4e07a7252125f5db7e8a9a
This commit is contained in:
Xingchao Yu
2013-09-26 18:11:52 +08:00
parent 0f032137a5
commit 2c9befed46
3 changed files with 11 additions and 0 deletions

View File

@@ -132,6 +132,7 @@ class openstack::all (
$mysql_account_security = true,
$mysql_bind_address = '0.0.0.0',
$allowed_hosts = '%',
$charset = 'latin1',
# Keystone
$keystone_host = '127.0.0.1',
$keystone_db_user = 'keystone',
@@ -291,6 +292,7 @@ class openstack::all (
neutron_db_password => $neutron_db_password,
neutron_db_dbname => $neutron_db_name,
allowed_hosts => $allowed_hosts,
charset => $charset,
enabled => $enabled,
}
} else {

View File

@@ -31,6 +31,7 @@
# [ceilometer_db_user]. Name of ceilometer DB user. Optional. Defaults to 'ceilometer'.
# [ceilometer_db_dbname]. Name of ceilometer DB. Optional. Defaults to 'ceilometer'.
# [allowed_hosts] List of hosts that are allowed access. Optional. Defaults to false.
# [charset] Name of mysql charset. Optional. Defaults to 'latin1'.
# [enabled] If the db service should be started. Optional. Defaults to true.
#
# === Example
@@ -85,6 +86,7 @@ class openstack::db::mysql (
$ceilometer_db_dbname = 'ceilometer',
# General
$allowed_hosts = false,
$charset = 'latin1',
$enabled = true
) {
@@ -109,6 +111,7 @@ class openstack::db::mysql (
password => $keystone_db_password,
dbname => $keystone_db_dbname,
allowed_hosts => $allowed_hosts,
charset => $charset,
}
# Create the Glance db
@@ -117,6 +120,7 @@ class openstack::db::mysql (
password => $glance_db_password,
dbname => $glance_db_dbname,
allowed_hosts => $allowed_hosts,
charset => $charset,
}
# Create the Nova db
@@ -125,6 +129,7 @@ class openstack::db::mysql (
password => $nova_db_password,
dbname => $nova_db_dbname,
allowed_hosts => $allowed_hosts,
charset => $charset,
}
# create cinder db
@@ -134,6 +139,7 @@ class openstack::db::mysql (
password => $cinder_db_password,
dbname => $cinder_db_dbname,
allowed_hosts => $allowed_hosts,
charset => $charset,
}
}
@@ -144,6 +150,7 @@ class openstack::db::mysql (
password => $neutron_db_password,
dbname => $neutron_db_dbname,
allowed_hosts => $allowed_hosts,
charset => $charset,
}
}
@@ -153,6 +160,7 @@ class openstack::db::mysql (
password => $ceilometer_db_password,
dbname => $ceilometer_db_dbname,
allowed_hosts => $allowed_hosts,
charset => $charset,
}
}
}

View File

@@ -283,6 +283,7 @@ describe 'openstack::all' do
it 'should have openstack::db::mysql configured' do
should contain_class('openstack::db::mysql').with(
:charset => 'latin1',
:mysql_root_password => 'sql_pass',
:mysql_bind_address => '0.0.0.0',
:mysql_account_security => true,