module-puppetlabs-mysql/templates/my.cnf.erb
Chris Edester fa968542e0 future parser converts explicit undef to empty string
With the future parser and puppet 4, explicit undef seems to be converted to blank string for erb templates
This change allows you to continue to omit config options in the main my.cnf
2014-09-15 13:10:17 -04:00

22 lines
605 B
Text

<% @options.sort.map do |k,v| -%>
<% if v.is_a?(Hash) -%>
[<%= k %>]
<% v.sort.map do |ki, vi| -%>
<% if ki == 'ssl-disable' or (ki =~ /^ssl/ and v['ssl-disable'] == true) -%>
<% next %>
<% elsif vi == true or v == '' -%>
<%= ki %>
<% elsif vi.is_a?(Array) -%>
<% vi.each do |vii| -%>
<%= ki %> = <%= vii %>
<% end -%>
<% elsif ![nil, '', :undef].include?(vi) -%>
<%= ki %> = <%= vi %>
<% end -%>
<% end -%>
<% end %>
<% end -%>
<% if @includedir and @includedir != '' %>
!includedir <%= @includedir %>
<% end %>