Add HOME environment variable for .my.cnf to mysqladmin command when (re)setting root password

This commit is contained in:
Mark Phillips 2013-08-14 15:48:56 -04:00
parent e2f3b54565
commit ae367272a2

View file

@ -172,11 +172,12 @@ class mysql::config(
}
exec { 'set_mysql_rootpw':
command => "mysqladmin -u root ${old_pw} password '${root_password}'",
logoutput => true,
unless => "mysqladmin -u root -p'${root_password}' status > /dev/null",
path => '/usr/local/sbin:/usr/bin:/usr/local/bin',
notify => $restart ? {
command => "mysqladmin -u root ${old_pw} password '${root_password}'",
logoutput => true,
environment => "HOME=${root_home}",
unless => "mysqladmin -u root -p'${root_password}' status > /dev/null",
path => '/usr/local/sbin:/usr/bin:/usr/local/bin',
notify => $restart ? {
true => Exec['mysqld-restart'],
false => undef,
},