summaryrefslogtreecommitdiff
path: root/manifests/init.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp17
1 files changed, 11 insertions, 6 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index ac7ccdd..f8b199b 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -1,6 +1,11 @@
-class etherpad {
- case $etherpad_db_password {
- '': { fail("You need to define etherpad database password! Please set \$etherpad_db_password in your site.pp or host config") }
+class etherpad(
+ $db_password = hiera('etherpad::db_password', ''),
+ $admin_password = hiera('etherpadd::admin_password', ''),
+ $api_key = hiera('etherpad::api_key, '')
+) {
+
+ case $db_password {
+ '': { fail("You need to define etherpad database password! Please set etherpadd::db_password in your config") }
}
mysql_database { 'etherpad':
@@ -9,7 +14,7 @@ class etherpad {
mysql_user { "etherpad@%":
ensure => present,
- password_hash => mysql_password($etherpad_db_password),
+ password_hash => mysql_password($db_password),
require => Mysql_database['etherpad'],
}
@@ -88,13 +93,13 @@ class etherpad {
notify => Service['etherpad-lite'],
}
- if $etherpad_api_key != '' {
+ if $api_key != '' {
file { '/var/lib/etherpad-lite/APIKEY.txt':
ensure => present,
owner => 'etherpad-lite',
group => 'etherpad-lite',
mode => 0640,
- content => "$etherpad_api_key",
+ content => "${api_key}",
require => Vcsrepo['/var/lib/etherpad-lite'],
notify => Service['etherpad-lite'],
}