4faa3f12ee
MySQL ecosystem has a lot of tools that use .my.cnf such as mysqldump or mysqladmin. Generating all sections allows operator to use them under root account without passing -p<password>
11 lines
346 B
Text
11 lines
346 B
Text
### MANAGED BY PUPPET ###
|
|
|
|
<% %w(mysql client mysqldump mysqladmin mysqlcheck).each do |section| %>
|
|
[<%= section -%>]
|
|
user=root
|
|
host=localhost
|
|
<% unless scope.lookupvar('mysql::server::root_password') == 'UNSET' -%>
|
|
password='<%= scope.lookupvar('mysql::server::root_password') %>'
|
|
<% end -%>
|
|
socket=<%= @options['client']['socket'] %>
|
|
<% end %>
|