summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-01-26 10:09:54 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-01-26 10:09:54 -0200
commit1d2ab744195e749ee2d032f46da3deae90dd4c99 (patch)
treef531119dd30e632eab1d953751d9a32357c1d829
parent2dbc1e9b41f12cbbe1ea7f4dd71f831fb787be8b (diff)
downloadpuppet-reprepro-1d2ab744195e749ee2d032f46da3deae90dd4c99.tar.gz
puppet-reprepro-1d2ab744195e749ee2d032f46da3deae90dd4c99.tar.bz2
Switching to parametrized classes
-rw-r--r--manifests/cron.pp2
-rw-r--r--manifests/init.pp18
-rw-r--r--manifests/inotify.pp3
-rw-r--r--manifests/lighty.pp1
4 files changed, 11 insertions, 13 deletions
diff --git a/manifests/cron.pp b/manifests/cron.pp
index 1fae59e..afaaa90 100644
--- a/manifests/cron.pp
+++ b/manifests/cron.pp
@@ -1,4 +1,4 @@
-class reprepro::cron inherits reprepro {
+class reprepro::cron {
cron { reprepro:
command => "/usr/bin/reprepro --silent -b $basedir processincoming incoming",
user => reprepro,
diff --git a/manifests/init.pp b/manifests/init.pp
index 5c24c63..0bab6d6 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -1,16 +1,14 @@
-class reprepro {
+class reprepro(
+ $origin = $::domain,
+ $uploaders = '',
+ $basedir = '/srv/reprepro'
+) {
- case $reprepro_origin {
- '': { $reprepro_origin = $domain }
- }
+ $reprepro_origin = $origin
+ $reprepro_uploaders = $uploaders
case $reprepro_uploaders {
- '': { fail("You need the repository uploaders! Please set \$reprepro_uploaders in your config") }
- }
-
- $basedir = $reprepro_basedir ? {
- '' => '/srv/reprepro',
- default => $reprepro_basedir,
+ '': { fail("You need the repository uploaders! Please pass \$uploaders parameter") }
}
case $lsbdistcodename {
diff --git a/manifests/inotify.pp b/manifests/inotify.pp
index 816441b..750ea57 100644
--- a/manifests/inotify.pp
+++ b/manifests/inotify.pp
@@ -1,4 +1,5 @@
-class reprepro::inotify inherits reprepro {
+class reprepro::inotify {
+
case $lsbdistcodename {
etch: {
package {
diff --git a/manifests/lighty.pp b/manifests/lighty.pp
index 4e34f5e..24228cf 100644
--- a/manifests/lighty.pp
+++ b/manifests/lighty.pp
@@ -1,5 +1,4 @@
class reprepro::lighty inherits lighttpd {
- include reprepro
file { "/etc/lighttpd/conf-available/20-reprepro.conf":
ensure => present,
content => "alias.url += ( \"/debian/\" => \"$reprepro::basedir/\" )\n";