summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDon Brewer <dbrewer@dbrewer-host.usersys.redhat.com>2008-06-06 11:59:27 -0400
committerDon Brewer <dbrewer@dbrewer-host.usersys.redhat.com>2008-06-06 11:59:27 -0400
commit392ef036b77b8160753b065bd21edc3f72447a01 (patch)
tree1ef24ec61a8bcc1a980fa9115e561e9d752268d5
parentebf989fc2ee2126e7b338b5651e7a68ef3cf11c6 (diff)
downloadpuppet-mysql-392ef036b77b8160753b065bd21edc3f72447a01.tar.gz
puppet-mysql-392ef036b77b8160753b065bd21edc3f72447a01.tar.xz
puppet-mysql-392ef036b77b8160753b065bd21edc3f72447a01.zip
added dropping of blank users from user table
-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'",