diff options
Diffstat (limited to 'manifests/init.pp')
-rw-r--r-- | manifests/init.pp | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 2d2aa30..bbeb17c 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, @@ -140,6 +161,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"; |