summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README19
-rw-r--r--manifests/init.pp47
-rw-r--r--templates/distributions.erb6
3 files changed, 62 insertions, 10 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..23b3765
--- /dev/null
+++ b/README
@@ -0,0 +1,19 @@
+Variables
+=========
+
+$reprepro_manage_distributions_conf, $reprepro_manage_incoming_conf
+-------------------------------------------------------------------
+
+If true, the content of -respectively- the conf/distributions and
+conf/incoming files is managed by this module. Else, only the
+existence, ownership and permissions are.
+
+Default: true.
+
+$reprepro_incoming_mode
+-----------------------
+
+This module manages the reprepro incoming directory and sets its
+permissions to $reprepro_incoming_mode.
+
+Default: 1777
diff --git a/manifests/init.pp b/manifests/init.pp
index f7f0a34..8268c8c 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -1,5 +1,13 @@
class reprepro {
+ case $reprepro_manage_distributions_conf {
+ '': { $reprepro_manage_distributions_conf = true }
+ }
+
+ case $reprepro_manage_incoming_conf {
+ '': { $reprepro_manage_incoming_conf = true }
+ }
+
case $reprepro_origin {
'': { $reprepro_origin = $domain }
}
@@ -17,17 +25,20 @@ class reprepro {
etch: {
package {
"reprepro": ensure => '3.9.2-1~bpo40+1';
- "inoticoming": ensure => '0.2.0-1~bpo40+1';
}
}
default: {
package {
"reprepro": ensure => 'installed';
- "inoticoming": ensure => 'installed';
}
}
}
+ $incoming_mode = $reprepro_incoming_mode ? {
+ '' => 1777,
+ default => $reprepro_incoming_mode,
+ }
+
user { "reprepro":
ensure => "present",
home => "$basedir",
@@ -66,7 +77,7 @@ class reprepro {
"$basedir/incoming":
ensure => directory,
- mode => 1777, owner => reprepro, group => reprepro;
+ mode => $incoming_mode, owner => reprepro, group => reprepro;
"$basedir/logs":
ensure => directory,
@@ -77,16 +88,14 @@ class reprepro {
mode => 0775, owner => reprepro, group => reprepro;
"$basedir/conf/distributions":
- mode => 0664, owner => root, group => reprepro,
- content => template("reprepro/distributions.erb");
+ mode => 0664, owner => root, group => reprepro;
"$basedir/conf/uploaders":
mode => 0660, owner => root, group => reprepro,
content => template("reprepro/uploaders.erb");
"$basedir/conf/incoming":
- mode => 0664, owner => root, group => reprepro,
- source => "puppet://$server/modules/reprepro/incoming";
+ mode => 0664, owner => root, group => reprepro;
"$basedir/index.html":
mode => 0664, owner => root, group => reprepro,
@@ -108,6 +117,18 @@ class reprepro {
mode => 755,
}
+ if $reprepro_manage_distributions_conf {
+ File["$basedir/conf/distributions"] {
+ content => template("reprepro/distributions.erb")
+ }
+ }
+
+ if $reprepro_manage_incoming_conf {
+ File["$basedir/conf/incoming"] {
+ source => "puppet://$server/modules/reprepro/incoming"
+ }
+ }
+
exec {
"reprepro -b $basedir createsymlinks":
refreshonly => true,
@@ -141,6 +162,18 @@ class reprepro::cron inherits reprepro {
}
class reprepro::inotify inherits reprepro {
+ case $lsbdistcodename {
+ etch: {
+ package {
+ "inoticoming": ensure => '0.2.0-1~bpo40+1';
+ }
+ }
+ default: {
+ package {
+ "inoticoming": ensure => 'installed';
+ }
+ }
+ }
file { "/etc/init.d/reprepro":
owner => root, group => root, mode => 0755,
source => "puppet://$server/modules/reprepro/inoticoming.init";
diff --git a/templates/distributions.erb b/templates/distributions.erb
index e004778..233f2b9 100644
--- a/templates/distributions.erb
+++ b/templates/distributions.erb
@@ -29,12 +29,12 @@ Codename: squeeze
Version: 6.0
Architectures: i386 amd64 source kfreebsd-amd64 kfreebsd-i386
Components: main non-free contrib
-Description: koumbit specific (or backported) packages
+Description: <%= reprepro_origin %> specific (or backported) packages
SignWith: yes
Uploaders: uploaders
-Origin: koumbit
-Label: koumbit
+Origin: <%= reprepro_origin %>
+Label: <%= reprepro_origin %>
Suite: testing
Pull: unstable
Codename: wheezy