aboutsummaryrefslogtreecommitdiffstats
path: root/modules/epoll
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2013-01-17 17:55:08 +0000
committerNicolas Vigier <boklm@mageia.org>2013-01-17 17:55:08 +0000
commitd8f14b69bf052a04718eb504a597a8e41e1122e8 (patch)
tree310ebd2c6e2df1c1f5562b5502e07f619edd5edf /modules/epoll
parent86114729e8c8288e12be7e494adfc302230f3931 (diff)
downloadpuppet-d8f14b69bf052a04718eb504a597a8e41e1122e8.tar
puppet-d8f14b69bf052a04718eb504a597a8e41e1122e8.tar.gz
puppet-d8f14b69bf052a04718eb504a597a8e41e1122e8.tar.bz2
puppet-d8f14b69bf052a04718eb504a597a8e41e1122e8.tar.xz
puppet-d8f14b69bf052a04718eb504a597a8e41e1122e8.zip
Add epoll::var class for epoll configuration
And move db password extlookup outside module
Diffstat (limited to 'modules/epoll')
-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