aboutsummaryrefslogtreecommitdiffstats
path: root/modules/buildsystem
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2013-05-22 22:16:58 +0000
committerNicolas Vigier <boklm@mageia.org>2013-05-22 22:16:58 +0000
commit77a70999df1bd4e67aadb02bd673449beae124b8 (patch)
treecf0fae1fc952ec3e2958e32c7441655f02848c17 /modules/buildsystem
parent9d7449fb7975570ab39f1ed64615188cbc8a4226 (diff)
downloadpuppet-77a70999df1bd4e67aadb02bd673449beae124b8.tar
puppet-77a70999df1bd4e67aadb02bd673449beae124b8.tar.gz
puppet-77a70999df1bd4e67aadb02bd673449beae124b8.tar.bz2
puppet-77a70999df1bd4e67aadb02bd673449beae124b8.tar.xz
puppet-77a70999df1bd4e67aadb02bd673449beae124b8.zip
buildsystem: move binrepo config to buildsystem::var::binrepo
Diffstat (limited to 'modules/buildsystem')
-rw-r--r--modules/buildsystem/manifests/binrepo.pp21
-rw-r--r--modules/buildsystem/manifests/var/binrepo.pp14
-rw-r--r--modules/buildsystem/templates/binrepo/sudoers.binrepo2
-rwxr-xr-xmodules/buildsystem/templates/binrepo/upload-bin8
-rw-r--r--modules/buildsystem/templates/binrepo/vhost_binrepo.conf2
-rw-r--r--modules/buildsystem/templates/binrepo/wrapper.upload-bin4
6 files changed, 29 insertions, 22 deletions
diff --git a/modules/buildsystem/manifests/binrepo.pp b/modules/buildsystem/manifests/binrepo.pp
index 037352a0..9c81530d 100644
--- a/modules/buildsystem/manifests/binrepo.pp
+++ b/modules/buildsystem/manifests/binrepo.pp
@@ -1,26 +1,19 @@
class buildsystem::binrepo {
+ include buildsystem::var::binrepo
include buildsystem::base
include sudo
- $login = 'binrepo'
- $homedir = "/var/lib/$login"
- $repodir = "$homedir/data"
-
- $uploadinfosdir = "$homedir/infos"
- $uploadbinpath = '/usr/local/bin/upload-bin'
- $uploadmail_from = "root@$::domain"
- $uploadmail_to = "packages-commits@ml.$::domain"
# used in templates
$packagers_committers_group = $buildsystem::base::packagers_committers_group
- user { $login:
+ user { $buildsystem::var::binrepo::login:
comment => 'Binary files repository',
- home => $homedir,
+ home => $buildsystem::var::binrepo::homedir,
}
- file { [$repodir, $uploadinfosdir]:
+ file { [$buildsystem::var::binrepo::repodir, $buildsystem::var::binrepo::uploadinfosdir]:
ensure => directory,
- owner => $login,
+ owner => $buildsystem::var::binrepo::login,
}
mga-common::local_script {
@@ -34,8 +27,8 @@ class buildsystem::binrepo {
content => template('buildsystem/binrepo/sudoers.binrepo')
}
- apache::vhost::base { "binrepo.$::domain":
- location => $repodir,
+ apache::vhost::base { "binrepo.${::domain}":
+ location => $buildsystem::var::binrepo::repodir,
content => template('buildsystem/binrepo/vhost_binrepo.conf'),
}
}
diff --git a/modules/buildsystem/manifests/var/binrepo.pp b/modules/buildsystem/manifests/var/binrepo.pp
new file mode 100644
index 00000000..d734c216
--- /dev/null
+++ b/modules/buildsystem/manifests/var/binrepo.pp
@@ -0,0 +1,14 @@
+# $uploadmail_from:
+# from who will be sent the binrepo upload email notifications
+# $uploadmail_to:
+# where binrepo email notifications are sent
+class buildsystem::var::binrepo(
+ $login = 'binrepo',
+ $homedir = '/var/lib/binrepo',
+ $uploadmail_from,
+ $uploadmail_to
+) {
+ $repodir = "$homedir/data"
+ $uploadinfosdir = "$homedir/infos"
+ $uploadbinpath = '/usr/local/bin/upload-bin'
+}
diff --git a/modules/buildsystem/templates/binrepo/sudoers.binrepo b/modules/buildsystem/templates/binrepo/sudoers.binrepo
index 405f43a3..99cfe91f 100644
--- a/modules/buildsystem/templates/binrepo/sudoers.binrepo
+++ b/modules/buildsystem/templates/binrepo/sudoers.binrepo
@@ -1 +1 @@
-%<%= packagers_committers_group %> ALL =(<%= login %>) NOPASSWD: <%= uploadbinpath %>
+%<%= packagers_committers_group %> ALL =(<%= scope.lookupvar('buildsystem::var::binrepo::login') %>) NOPASSWD: <%= scope.lookupvar('buildsystem::var::binrepo::uploadbinpath') %>
diff --git a/modules/buildsystem/templates/binrepo/upload-bin b/modules/buildsystem/templates/binrepo/upload-bin
index f90130f3..7cad5838 100755
--- a/modules/buildsystem/templates/binrepo/upload-bin
+++ b/modules/buildsystem/templates/binrepo/upload-bin
@@ -1,11 +1,11 @@
#!/bin/sh
set -e
-binrepodir=<%= repodir %>
-uploadinfosdir=<%= uploadinfosdir %>
+binrepodir=<%= scope.lookupvar('buildsystem::var::binrepo::repodir') %>
+uploadinfosdir=<%= scope.lookupvar('buildsystem::var::binrepo::uploadinfosdir') %>
tmpfile=$(mktemp)
-mail_from="<%= uploadmail_from %>"
-mail_dest="<%= uploadmail_to %>"
+mail_from="<%= scope.lookupvar('buildsystem::var::binrepo::uploadmail_from') %>"
+mail_dest="<%= scope.lookupvar('buildsystem::var::binrepo::uploadmail_to') %>"
test $# = 2 || exit 3
username="$1"
diff --git a/modules/buildsystem/templates/binrepo/vhost_binrepo.conf b/modules/buildsystem/templates/binrepo/vhost_binrepo.conf
index ce29accf..f411c07a 100644
--- a/modules/buildsystem/templates/binrepo/vhost_binrepo.conf
+++ b/modules/buildsystem/templates/binrepo/vhost_binrepo.conf
@@ -1,3 +1,3 @@
-<Directory <%= repodir %>>
+<Directory <%= scope.lookupvar('buildsystem::var::binrepo::repodir') %>>
Options None
</Directory>
diff --git a/modules/buildsystem/templates/binrepo/wrapper.upload-bin b/modules/buildsystem/templates/binrepo/wrapper.upload-bin
index 48385a47..bcc193fb 100644
--- a/modules/buildsystem/templates/binrepo/wrapper.upload-bin
+++ b/modules/buildsystem/templates/binrepo/wrapper.upload-bin
@@ -1,7 +1,7 @@
#!/bin/sh
-binrepouser="<%= login %>"
-uploadbinpath="<%= uploadbinpath %>"
+binrepouser="<%= scope.lookupvar('buildsystem::var::binrepo::login') %>"
+uploadbinpath="<%= scope.lookupvar('buildsystem::var::binrepo::uploadbinpath') %>"
packagerscommittersgroup="<%= packagers_committers_group %>"
function isingroup()