From 63a300f108b14236565f3e5263a987337ffdd101 Mon Sep 17 00:00:00 2001 From: Vladimir Kuklin Date: Fri, 2 May 2014 18:00:04 +0400 Subject: [PATCH] Fix galera helper execs to use replication user Set galera helper execs to use replication user credentials in order to not mess with root password setup. Change-Id: If18be6f709271c0953b557c628132f53bcec5626 Closes-Bug: #1315396 --- deployment/puppet/galera/manifests/init.pp | 6 ++++-- deployment/puppet/mysql/manifests/password.pp | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/deployment/puppet/galera/manifests/init.pp b/deployment/puppet/galera/manifests/init.pp index 6f466bea13..b7a5eadfc9 100644 --- a/deployment/puppet/galera/manifests/init.pp +++ b/deployment/puppet/galera/manifests/init.pp @@ -258,9 +258,11 @@ class galera ( # This exec waits for initial sync of galera cluster after mysql replication user creation. + + $user_password_string="-u${mysql_user} -p${mysql_password}" exec { "wait-initial-sync": logoutput => true, - command => "/usr/bin/mysql -Nbe \"show status like 'wsrep_local_state_comment'\" | /bin/grep -q -e Synced -e Initialized && sleep 10", + command => "/usr/bin/mysql ${user_password_string} -Nbe \"show status like 'wsrep_local_state_comment'\" | /bin/grep -q -e Synced -e Initialized && sleep 10", try_sleep => 5, tries => 60, refreshonly => true, @@ -272,7 +274,7 @@ class galera ( exec { "wait-for-synced-state": logoutput => true, - command => "/usr/bin/mysql -Nbe \"show status like 'wsrep_local_state_comment'\" | /bin/grep -q Synced && sleep 10", + command => "/usr/bin/mysql ${user_password_string} -Nbe \"show status like 'wsrep_local_state_comment'\" | /bin/grep -q Synced && sleep 10", try_sleep => 5, tries => 60, } diff --git a/deployment/puppet/mysql/manifests/password.pp b/deployment/puppet/mysql/manifests/password.pp index 3b47fb6060..29339d972b 100644 --- a/deployment/puppet/mysql/manifests/password.pp +++ b/deployment/puppet/mysql/manifests/password.pp @@ -37,9 +37,9 @@ class mysql::password ( Exec['set_mysql_rootpw'] -> File['mysql_password'] File <| title == $config_file |> -> File['mysql_password'] File <| title == '/etc/my.cnf' |> -> File['mysql_password'] - File['mysql_password'] -> Database <||> - File['mysql_password'] -> Database_grant <||> - File['mysql_password'] -> Database_user <||> + File['mysql_password'] -> Database <| provider=='mysql' |> + File['mysql_password'] -> Database_grant <| provider=='mysql' |> + File['mysql_password'] -> Database_user <| provider=='mysql' |> if defined(Class['galera']) { Class['galera'] -> Class['mysql::password'] @@ -47,4 +47,4 @@ class mysql::password ( } -} \ No newline at end of file +}