module-puppetlabs-mysql/templates/my.cnf.pass.erb
Sergii Golovatiuk 4faa3f12ee Generate .my.cnf for all sections
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>
2016-02-18 11:48:16 +01:00

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 %>