From 392ef036b77b8160753b065bd21edc3f72447a01 Mon Sep 17 00:00:00 2001 From: Don Brewer Date: Fri, 6 Jun 2008 11:59:27 -0400 Subject: added dropping of blank users from user table --- manifests/init.pp | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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'", -- cgit