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>
This commit is contained in:
parent
7a92634f69
commit
4faa3f12ee
1 changed files with 4 additions and 2 deletions
|
@ -1,9 +1,11 @@
|
||||||
### MANAGED BY PUPPET ###
|
### MANAGED BY PUPPET ###
|
||||||
|
|
||||||
[client]
|
<% %w(mysql client mysqldump mysqladmin mysqlcheck).each do |section| %>
|
||||||
|
[<%= section -%>]
|
||||||
user=root
|
user=root
|
||||||
host=localhost
|
host=localhost
|
||||||
<% unless scope.lookupvar('mysql::server::root_password') == 'UNSET' -%>
|
<% unless scope.lookupvar('mysql::server::root_password') == 'UNSET' -%>
|
||||||
password='<%= scope.lookupvar('mysql::server::root_password') %>'
|
password='<%= scope.lookupvar('mysql::server::root_password') %>'
|
||||||
<% end -%>
|
<% end -%>
|
||||||
socket=<%= @options['client']['socket'] -%>
|
socket=<%= @options['client']['socket'] %>
|
||||||
|
<% end %>
|
||||||
|
|
Loading…
Reference in a new issue