Skip to content

Commit 6228846

Browse files
committed
Fix when not managing config file
This code have been remove here 4bab65e#diff-0938042fe2382aeb10032aa7f8444995 but it is required otherwise we get an `Evaluation Error: Unknown variable: 'install_db_args'.` when using `manage_config_file = false`
1 parent 7681c13 commit 6228846

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

manifests/server/installdb.pp

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
if $mysql::server::manage_config_file {
1313
$install_db_args = "--basedir=${basedir} --defaults-extra-file=${config_file} --datadir=${datadir} --user=${mysqluser}"
14-
14+
} else {
15+
$install_db_args = "--basedir=${basedir} --datadir=${datadir} --user=${mysqluser}"
1516
}
1617

1718
exec { 'mysql_install_db':

spec/classes/mysql_server_spec.rb

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
it { is_expected.to contain_class('mysql::server::account_security') }
2020
end
2121

22+
context 'when not managing config file' do
23+
let(:params) {{ :manage_config_file => false }}
24+
it { is_expected.to compile.with_all_deps }
25+
end
26+
2227
context 'mysql::server::install' do
2328
it 'contains the package by default' do
2429
is_expected.to contain_package('mysql-server').with({

0 commit comments

Comments
 (0)