diff --git a/spec/classes/mycnf_template_spec.rb b/spec/classes/mycnf_template_spec.rb index 6446c90..9c0c433 100644 --- a/spec/classes/mycnf_template_spec.rb +++ b/spec/classes/mycnf_template_spec.rb @@ -29,6 +29,11 @@ describe 'mysql::server' do end end + describe 'skip-name-resolve set to an empty string' do + let(:params) {{ :override_options => { 'mysqld' => { 'skip-name-resolve' => '' }}}} + it { is_expected.to contain_file('mysql-config-file').with_content(/^skip-name-resolve$/) } + end + describe 'ssl set to true' do let(:params) {{ :override_options => { 'mysqld' => { 'ssl' => true }}}} it { is_expected.to contain_file('mysql-config-file').with_content(/ssl/) } diff --git a/templates/my.cnf.erb b/templates/my.cnf.erb index 7d832d9..7d1f148 100644 --- a/templates/my.cnf.erb +++ b/templates/my.cnf.erb @@ -6,7 +6,7 @@ <% v.sort.map do |ki, vi| -%> <% if ki == 'ssl-disable' or (ki =~ /^ssl/ and v['ssl-disable'] == true) -%> <% next %> -<% elsif vi == true or v == '' -%> +<% elsif vi == true or vi == '' -%> <%= ki %> <% elsif vi.is_a?(Array) -%> <% vi.each do |vii| -%>