summaryrefslogtreecommitdiffstats
path: root/manifests/init.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp12
1 files changed, 12 insertions, 0 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 479510d..d7c4d77 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -67,6 +67,18 @@ class mysql::server {
require => Exec["mysql root password init"],
}
+ exec {"drop blank user with hostname as localhost":
+ command => "$mysql_cmd_root_with_pwd --execute=\"drop user ' '@'$mysql_root_local_host';\"",
+ onlyif => "$mysql_cmd_root_with_pwd --execute=\"select * from user where user = ' ';\" | grep $mysql_root_local_host",
+ require => Exec["mysql root flush password"],
+ }
+
+ exec {"drop blank user with hostname as hqdn facter":
+ command => "$mysql_cmd_root_with_pwd --execute=\"drop user ' '@'$fqdn';\"",
+ onlyif => "$mysql_cmd_root_with_pwd --execute=\"select * from user where user = ' ';\" | grep $fqdn",
+ require => Exec["mysql root flush password"],
+ }
+
exec {"mysql create replication user":
command => "$mysql_cmd_root_with_pwd --execute=\"Create user '$mysql_replication_user'@'$mysql_global_host' identified by '$mysql_replication_password';\"",
unless => "$mysql_cmd_repl_with_pwd --execute '\s'",