aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/epoll/manifests/init.pp11
-rw-r--r--modules/epoll/manifests/var.pp30
-rw-r--r--modules/epoll/templates/epoll.yml2
3 files changed, 35 insertions, 8 deletions
diff --git a/modules/epoll/manifests/init.pp b/modules/epoll/manifests/init.pp
index f00d2a3e..2d61b517 100644
--- a/modules/epoll/manifests/init.pp
+++ b/modules/epoll/manifests/init.pp
@@ -1,22 +1,19 @@
class epoll {
-
- $vhost = "epoll.$::domain"
+ include epoll::var
package { 'Epoll': }
- apache::vhost::catalyst_app { $vhost:
+ apache::vhost::catalyst_app { $epoll::var::vhost:
script => '/usr/bin/epoll_fastcgi.pl',
use_ssl => true,
require => Package['Epoll']
}
- apache::vhost::redirect_ssl { $vhost: }
-
- $pgsql_password = extlookup('epoll_pgsql','x')
+ apache::vhost::redirect_ssl { $epoll::var::vhost: }
postgresql::remote_db_and_user { 'epoll':
description => 'Epoll database',
- password => $pgsql_password,
+ password => $epoll::var::db_password,
}
file { 'epoll.yml':
diff --git a/modules/epoll/manifests/var.pp b/modules/epoll/manifests/var.pp
new file mode 100644
index 00000000..e1393771
--- /dev/null
+++ b/modules/epoll/manifests/var.pp
@@ -0,0 +1,30 @@
+# == Class: epoll::var
+#
+# epoll configuration
+#
+# === Parameters
+#
+# [*vhost*]
+# epoll vhost
+#
+# [*db_hostname*]
+# hostname of the database server
+#
+# [*db_name*]
+# name of the database
+#
+# [*db_user*]
+# user to connect to the database
+#
+# [*db_password*]
+# password to connect to the database
+#
+class epoll::var (
+ $vhost = "epoll.$::domain"
+ $db_hostname = 'localhost',
+ $db_name = 'epoll',
+ $db_user = 'epoll',
+ $db_password
+) {
+}
+# vim: sw=2
diff --git a/modules/epoll/templates/epoll.yml b/modules/epoll/templates/epoll.yml
index 0ca519c9..a6d078ff 100644
--- a/modules/epoll/templates/epoll.yml
+++ b/modules/epoll/templates/epoll.yml
@@ -2,7 +2,7 @@
name: Vote
# db: connection, see libpq documentation
# dbname=BASENAME;host=SERVER;user=USER;password=PASS
-db: dbname=epoll;host=localhost;user=epoll;password=<%= pgsql_password %>
+db: dbname=<%= scope.lookupvar('epoll::var::db_name') %>;host=<%= scope.lookupvar('epoll::var::db_hostname') %>;user=<%= scope.lookupvar('epoll::var::db_user') %>;password=<%= scope.lookupvar('epoll::var::db_password') %>
# The smtp serveur to use, default is localhost
# smtp:
# This change the poll creation behavior, instead ask want confirmation by