Merge pull request #74 from jmchilton/specify_engine

Allow consumer to specify default storage engine for MySQL server.
This commit is contained in:
Dan Bode 2012-05-15 18:07:46 -07:00
commit 65de49f090
3 changed files with 21 additions and 13 deletions

View file

@ -43,7 +43,8 @@ class mysql::config(
$ssl_ca = $mysql::params::ssl_ca,
$ssl_cert = $mysql::params::ssl_cert,
$ssl_key = $mysql::params::ssl_key,
$log_error = $mysql::params::log_error
$log_error = $mysql::params::log_error,
$default_engine = 'UNSET'
) inherits mysql::params {
File {

View file

@ -9,6 +9,7 @@ describe 'mysql::config' do
:port => '3306',
:etc_root_password => false,
:datadir => '/var/lib/mysql',
:default_engine => 'UNSET',
:ssl => false,
:ssl_ca => '/etc/mysql/cacert.pem',
:ssl_cert => '/etc/mysql/server-cert.pem',
@ -74,17 +75,18 @@ describe 'mysql::config' do
[
{},
{
:service_name => 'dans_service',
:config_file => '/home/dan/mysql.conf',
:service_name => 'dans_mysql',
:socket => '/home/dan/mysql.sock',
:bind_address => '0.0.0.0',
:port => '3306',
:datadir => '/path/to/datadir',
:ssl => true,
:ssl_ca => '/path/to/cacert.pem',
:ssl_cert => '/path/to/server-cert.pem',
:ssl_key => '/path/to/server-key.pem'
:service_name => 'dans_service',
:config_file => '/home/dan/mysql.conf',
:service_name => 'dans_mysql',
:socket => '/home/dan/mysql.sock',
:bind_address => '0.0.0.0',
:port => '3306',
:datadir => '/path/to/datadir',
:default_engine => 'InnoDB',
:ssl => true,
:ssl_ca => '/path/to/cacert.pem',
:ssl_cert => '/path/to/server-cert.pem',
:ssl_key => '/path/to/server-key.pem'
}
].each do |passed_params|
@ -140,6 +142,9 @@ describe 'mysql::config' do
"datadir = #{param_values[:datadir]}",
"bind-address = #{param_values[:bind_address]}"
]
if param_values[:default_engine] != 'UNSET'
expected_lines = expected_lines | [ "default-storage-engine = #{param_values[:default_engine]}" ]
end
if param_values[:ssl]
expected_lines = expected_lines |
[

View file

@ -23,7 +23,9 @@ query_cache_size = 16M
log_error = <%= log_error %>
expire_logs_days = 10
max_binlog_size = 100M
<% if default_engine != 'UNSET' %>
default-storage-engine = <%= default_engine %>
<% end %>
<% if ssl == true %>
ssl-ca = <%= ssl_ca %>
ssl-cert = <%= ssl_cert %>