From ddc264f0824558025a8ecdee1e0d1f4dcf14f7a0 Mon Sep 17 00:00:00 2001 From: calfonso Date: Wed, 16 Apr 2008 15:12:31 -0400 Subject: Fixing the datasource user priviliges --- manifests/init.pp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index d202785..e4386b0 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -171,10 +171,15 @@ define mysql::datasource($rootpw, $ds_name, $ds_owner, $ds_owner_pwd, $ds_user, exec { "create grants $ds_name": command => "$mysql_root_cmd -e \"GRANT ALL PRIVILEGES ON *.* TO '$ds_owner'@'%' IDENTIFIED BY '$ds_owner_pwd' WITH GRANT OPTION;\"", - unless => "/usr/bin/mysql --host $ipaddress --user=$ds_owner -password=$ds_password -e '\s'", + unless => "/usr/bin/mysql --host $ipaddress --user=$ds_owner -password=$ds_owner_pwd -e '\s'", require => [Service["mysql"], Exec["mysql root password init"]], } + exec { "create grants $ds_owner": + command => "$mysql_root_cmd -e \"GRANT SELECT,INSERT,UPDATE,DELETE ON $ds_name.* TO '$ds_user'@'%' IDENTIFIED BY '$ds_user_pwd';\"", + unless => "/usr/bin/mysql --host $ipaddress --user=$ds_user -password=$ds_user_pwd -e '\s'", + require => [Service["mysql"], Exec["mysql root password init"]], + } # Only create the schema is a template directory was specified if $ds_schema { exec { "create db $ds_name": -- cgit