Skip to content

Commit 9d69afc

Browse files
committed
Conflicts: manifests/config.pp spec/classes/mysql_config_spec.rb
2 parents 6cef2e8 + aa5d1f0 commit 9d69afc

File tree

5 files changed

+31
-30
lines changed

5 files changed

+31
-30
lines changed

manifests/config.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
$query_cache_size = $mysql::query_cache_size,
113113
$max_binlog_size = $mysql::max_binlog_size,
114114
$expire_logs_days = $mysql::expire_logs_days,
115-
$max_connections = 'UNSET',
115+
$max_connections = $mysql::max_connections,
116116
$tmp_table_size = 'UNSET',
117117
$max_heap_table_size = 'UNSET',
118118
$table_open_cache = 'UNSET',

manifests/init.pp

+1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
$port = $mysql::params::port,
113113
$purge_conf_dir = $mysql::params::purge_conf_dir,
114114
$python_package_name = $mysql::params::python_package_name,
115+
$max_connections = $mysql::params::max_connections,
115116
$restart = $mysql::params::restart,
116117
$root_group = $mysql::params::root_group,
117118
$root_password = $mysql::params::root_password,

manifests/params.pp

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
$old_root_password = ''
2121
$package_ensure = 'present'
2222
$purge_conf_dir = false
23+
$max_connections = 151
2324
$port = 3306
2425
$max_allowed_packet = '16M'
2526
$root_password = 'UNSET'

spec/classes/mysql_config_spec.rb

+27-29
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
{
66
:root_password => 'UNSET',
77
:old_root_password => '',
8+
:max_connections => '151',
89
:bind_address => '127.0.0.1',
910
:port => '3306',
1011
:etc_root_password => false,
@@ -21,7 +22,6 @@
2122
:max_binlog_size => '100M',
2223
:expire_logs_days => 10,
2324
:character_set => 'UNSET',
24-
:max_connections => 'UNSET',
2525
:tmp_table_size => 'UNSET',
2626
:max_heap_table_size => 'UNSET',
2727
:table_open_cache => 'UNSET',
@@ -40,34 +40,34 @@
4040
describe 'with osfamily specific defaults' do
4141
{
4242
'Debian' => {
43-
:datadir => '/var/lib/mysql',
44-
:service_name => 'mysql',
45-
:config_file => '/etc/mysql/my.cnf',
46-
:socket => '/var/run/mysqld/mysqld.sock',
47-
:pidfile => '/var/run/mysqld/mysqld.pid',
48-
:root_group => 'root',
49-
:ssl_ca => '/etc/mysql/cacert.pem',
50-
:ssl_cert => '/etc/mysql/server-cert.pem',
51-
:ssl_key => '/etc/mysql/server-key.pem'
43+
:datadir => '/var/lib/mysql',
44+
:service_name => 'mysql',
45+
:config_file => '/etc/mysql/my.cnf',
46+
:socket => '/var/run/mysqld/mysqld.sock',
47+
:pidfile => '/var/run/mysqld/mysqld.pid',
48+
:root_group => 'root',
49+
:ssl_ca => '/etc/mysql/cacert.pem',
50+
:ssl_cert => '/etc/mysql/server-cert.pem',
51+
:ssl_key => '/etc/mysql/server-key.pem'
5252
},
5353
'FreeBSD' => {
54-
:datadir => '/var/db/mysql',
55-
:service_name => 'mysql-server',
56-
:config_file => '/var/db/mysql/my.cnf',
57-
:socket => '/tmp/mysql.sock',
58-
:pidfile => '/var/db/mysql/mysql.pid',
59-
:root_group => 'wheel'
54+
:datadir => '/var/db/mysql',
55+
:service_name => 'mysql-server',
56+
:config_file => '/var/db/mysql/my.cnf',
57+
:socket => '/tmp/mysql.sock',
58+
:pidfile => '/var/db/mysql/mysql.pid',
59+
:root_group => 'wheel'
6060
},
6161
'RedHat' => {
62-
:datadir => '/var/lib/mysql',
63-
:service_name => 'mysqld',
64-
:config_file => '/etc/my.cnf',
65-
:socket => '/var/lib/mysql/mysql.sock',
66-
:pidfile => '/var/run/mysqld/mysqld.pid',
67-
:root_group => 'root',
68-
:ssl_ca => '/etc/mysql/cacert.pem',
69-
:ssl_cert => '/etc/mysql/server-cert.pem',
70-
:ssl_key => '/etc/mysql/server-key.pem'
62+
:datadir => '/var/lib/mysql',
63+
:service_name => 'mysqld',
64+
:config_file => '/etc/my.cnf',
65+
:socket => '/var/lib/mysql/mysql.sock',
66+
:pidfile => '/var/run/mysqld/mysqld.pid',
67+
:root_group => 'root',
68+
:ssl_ca => '/etc/mysql/cacert.pem',
69+
:ssl_cert => '/etc/mysql/server-cert.pem',
70+
:ssl_key => '/etc/mysql/server-key.pem'
7171
}
7272
}.each do |osfamily, osparams|
7373

@@ -208,6 +208,7 @@
208208
"socket = #{param_values[:socket]}",
209209
"pid-file = #{param_values[:pidfile]}",
210210
"datadir = #{param_values[:datadir]}",
211+
"max_connections = #{param_values[:max_connections]}",
211212
"bind-address = #{param_values[:bind_address]}",
212213
"key_buffer = #{param_values[:key_buffer]}",
213214
"max_allowed_packet = #{param_values[:max_allowed_packet]}",
@@ -219,9 +220,6 @@
219220
"expire_logs_days = #{param_values[:expire_logs_days]}",
220221
"max_binlog_size = #{param_values[:max_binlog_size]}"
221222
]
222-
if param_values[:max_connections] != 'UNSET'
223-
expected_lines = expected_lines | [ "max_connections = #{param_values[:max_connections]}" ]
224-
end
225223
if param_values[:tmp_table_size] != 'UNSET'
226224
expected_lines = expected_lines | [ "tmp_table_size = #{param_values[:tmp_table_size]}" ]
227225
end
@@ -320,7 +318,7 @@
320318

321319
describe 'unset ssl params should fail when ssl is true on freebsd' do
322320
let :facts do
323-
{:osfamily => 'FreeBSD'}
321+
{:osfamily => 'FreeBSD'}
324322
end
325323

326324
let :params do

templates/my.cnf.erb

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ port = <%= @port %>
1919
basedir = <%= @basedir %>
2020
datadir = <%= @datadir %>
2121
tmpdir = <%= @tmpdir %>
22+
max_connections = <%= @max_connections %>
2223
skip-external-locking
2324

2425
<% if @bind_address -%>

0 commit comments

Comments
 (0)