From ae367272a2c0e3b8e0d1b2a0cdbfb1a28ddc5fc8 Mon Sep 17 00:00:00 2001 From: Mark Phillips Date: Wed, 14 Aug 2013 15:48:56 -0400 Subject: [PATCH] Add HOME environment variable for .my.cnf to mysqladmin command when (re)setting root password --- manifests/config.pp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index ccdb98f..c3d0cf3 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -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, },