Allow override_options to set an option to undef to completely remove it

allowing reverting to mysql's default value.

Note that previously a value of :undef would have led to a nonsensical
my.cnf file.
This commit is contained in:
Jim Radford 2014-01-23 16:55:48 -08:00
parent 136b1aa646
commit 56e81a38c8
2 changed files with 3 additions and 4 deletions

View file

@ -82,8 +82,7 @@ For items that you would traditionally represent as:
thing = X
</pre>
You can just make an entry like `thing => true`, `thing => value`, or `thing => "` in the hash. You can also pass an array `thing => ['value', 'value2']` or even list each `thing => value` separately on separate lines. MySQL doesn't care if 'thing' is alone or set to a value; it'll happily accept both.
You can just make an entry like `thing => true`, `thing => value`, or `thing => "` in the hash. You can also pass an array `thing => ['value', 'value2']` or even list each `thing => value` separately on separate lines. MySQL doesn't care if 'thing' is alone or set to a value; it'll happily accept both. To keep an option out of the my.cnf file, e.g. when using override_options to revert to a default value, you can pass thing => undef.
If an option needs multiple instances, you can pass an array. For example
```puppet
@ -164,7 +163,7 @@ For items that you would traditionally represent as:
thing = X
</pre>
You can just make an entry like `thing => true`, `thing => value`, or `thing => "` in the hash. You can also pass an array `thing => ['value', 'value2']` or even list each `thing => value` separately on separate lines. MySQL doesn't care if 'thing' is alone or set to a value; it'll happily accept both.
You can just make an entry like `thing => true`, `thing => value`, or `thing => "` in the hash. You can also pass an array `thing => ['value', 'value2']` or even list each `thing => value` separately on separate lines. MySQL doesn't care if 'thing' is alone or set to a value; it'll happily accept both. To keep an option out of the my.cnf file, e.g. when using override_options to revert to a default value, you can pass thing => undef.
#####`config_file`

View file

@ -8,7 +8,7 @@
<% vi.each do |vii| -%>
<%= ki %> = <%= vii %>
<% end -%>
<% else -%>
<% elsif vi != :undef -%>
<%= ki %> = <%= vi %>
<% end -%>
<% end -%>