diff --git a/manifests/client.pp b/manifests/client.pp index 58cd04f71..1c9df9d99 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -25,6 +25,7 @@ $package_ensure = $mysql::params::client_package_ensure, $package_manage = $mysql::params::client_package_manage, $package_name = $mysql::params::client_package_name, + $safe_updates = $mysql::params::safe_updates, ) inherits mysql::params { include '::mysql::client::install' diff --git a/manifests/params.pp b/manifests/params.pp index e28fa0071..17ed73da5 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -18,6 +18,7 @@ $client_package_manage = true $create_root_user = true $create_root_my_cnf = true + $safe_updates = false # mysql::bindings $bindings_enable = false $java_package_ensure = 'present' diff --git a/spec/functions/mysql_deepmerge_spec.rb b/spec/functions/mysql_deepmerge_spec.rb index e5e9a66ef..6b5e58121 100644 --- a/spec/functions/mysql_deepmerge_spec.rb +++ b/spec/functions/mysql_deepmerge_spec.rb @@ -23,7 +23,7 @@ index_values = ['one', 'two', 'three'] expected_values_one = ['1', '2', '2'] it 'is able to mysql_deepmerge two hashes' do - new_hash = subject.execute({ 'one' => '1', 'two' => '1' }, 'two' => '2', 'three' => '2') + new_hash = subject.execute({ 'one' => 1, 'two' => 1 }, 'two' => 2, 'three' => 2) index_values.each_with_index do |index, expected| expect(new_hash[index]).to eq(expected_values_one[expected]) end diff --git a/templates/my.cnf.pass.erb b/templates/my.cnf.pass.erb index b82cca3f7..9af7079aa 100644 --- a/templates/my.cnf.pass.erb +++ b/templates/my.cnf.pass.erb @@ -4,6 +4,9 @@ [<%= section -%>] user=root host=localhost +<% if section == 'client' and scope.lookupvar('mysql::client::safe_updates') != 'UNSET' -%> +safe-updates=<%= scope.lookupvar('mysql::client::safe_updates') ? 1 : 0 %> +<% end -%> <% unless scope.lookupvar('mysql::server::root_password') == 'UNSET' -%> password='<%= scope.lookupvar('mysql::server::root_password') %>' <% end -%>