From 4526b72d6be7a3f07555c7a5d9d5c587ea32e1e0 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 26 Dec 2011 14:15:27 -0200 Subject: Fixing database definitions --- manifests/init.pp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index a467472..927be2d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -3,8 +3,19 @@ class etherpad { '': { fail("You need to define etherpad database password! Please set \$etherpad_db_password in your site.pp or host config") } } - database::instance { "etherpad": - password => $etherpad_db_password, + mysql_database { 'etherpad': + ensure => present, + } + + mysql_user { "etherpad@%": + ensure => present, + password_hash => mysql_password($etherpad_db_password), + require => Mysql_database['etherpad'], + } + + mysql_grant { "etherpad@%/etherpad": + privileges => 'all', + require => Mysql_user["etherpad@%"], } user { "etherpad-lite": @@ -74,7 +85,6 @@ class etherpad { hasrestart => true, hasstatus => true, require => [ File['/etc/init.d/etherpad-lite', '/var/lib/etherpad-lite/settings.json'], - Mysql_database['etherpad'], Mysql_user['etherpad'], - Mysql_grant['etherpad'], Package['npm'] ], + Mysql_grant['etherpad@%/etherpad'], Package['npm'] ], } } -- cgit v1.2.3