aboutsummaryrefslogtreecommitdiffstats
path: root/modules/buildsystem
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2012-01-07 23:19:13 +0000
committerMichael Scherer <misc@mageia.org>2012-01-07 23:19:13 +0000
commitb07f0c0edb8d687bcd3c06d3c185bf49fc2e2754 (patch)
tree35b5a07b9c1f21b7046cf65b1f333a236efb8b18 /modules/buildsystem
parent51d5e0fb26b3238084845b1ba324fd2fc95b5e95 (diff)
downloadpuppet-b07f0c0edb8d687bcd3c06d3c185bf49fc2e2754.tar
puppet-b07f0c0edb8d687bcd3c06d3c185bf49fc2e2754.tar.gz
puppet-b07f0c0edb8d687bcd3c06d3c185bf49fc2e2754.tar.bz2
puppet-b07f0c0edb8d687bcd3c06d3c185bf49fc2e2754.tar.xz
puppet-b07f0c0edb8d687bcd3c06d3c185bf49fc2e2754.zip
split maintdb in a separate class, and clean it a little bit
Diffstat (limited to 'modules/buildsystem')
-rw-r--r--modules/buildsystem/manifests/init.pp74
-rw-r--r--modules/buildsystem/manifests/maintdb.pp71
-rw-r--r--modules/buildsystem/templates/sudoers.maintdb4
-rw-r--r--modules/buildsystem/templates/wrapper.maintdb2
4 files changed, 74 insertions, 77 deletions
diff --git a/modules/buildsystem/manifests/init.pp b/modules/buildsystem/manifests/init.pp
index d51c0be4..8deed56f 100644
--- a/modules/buildsystem/manifests/init.pp
+++ b/modules/buildsystem/manifests/init.pp
@@ -112,80 +112,6 @@ class buildsystem {
}
}
- class maintdb inherits base {
- include sudo
- $maintdb_login = "maintdb"
- $maintdb_homedir = "/var/lib/maintdb"
- $maintdb_dbdir = "$maintdb_homedir/db"
- $maintdb_binpath = "/usr/local/sbin/maintdb"
- $maintdb_wrappath = "/usr/local/bin/wrapper.maintdb"
- $maintdb_dump = "/var/www/bs/data/maintdb.txt"
- $maintdb_unmaintained = "/var/www/bs/data/unmaintained.txt"
-
- user {"$maintdb_login":
- ensure => present,
- comment => "Maintainers database",
- managehome => true,
- shell => "/bin/bash",
- home => "$maintdb_homedir",
- }
-
- file { "$maintdb_homedir":
- ensure => directory,
- owner => "$maintdb_login",
- group => "$maintdb_login",
- mode => 711,
- require => User["$maintdb_login"],
- }
-
- file { "$maintdb_dbdir":
- ensure => directory,
- owner => "$maintdb_login",
- group => "$maintdb_login",
- mode => 711,
- require => User["$maintdb_login"],
- }
-
- file { "$maintdb_binpath":
- ensure => present,
- owner => root,
- group => root,
- mode => 755,
- content => template("buildsystem/maintdb")
- }
-
- file { "$maintdb_wrappath":
- ensure => present,
- owner => root,
- group => root,
- mode => 755,
- content => template("buildsystem/wrapper.maintdb")
- }
-
- sudo::sudoers_config { "maintdb":
- content => template("buildsystem/sudoers.maintdb")
- }
-
- file { ["$maintdb_dump","$maintdb_dump.new"]:
- ensure => present,
- owner => $maintdb_login,
- mode => 644,
- require => File["/var/www/bs/data"],
- }
-
- cron { "update maintdb export":
- user => $maintdb_login,
- command => "$maintdb_binpath root get > $maintdb_dump.new; mv -f $maintdb_dump.new $maintdb_dump; grep ' nobody\$' $maintdb_dump | sed 's/ nobody\$//' > $maintdb_unmaintained.new; mv -f $maintdb_unmaintained.new $maintdb_unmaintained",
- minute => "*/30",
- require => User[$maintdb_login],
- }
-
- apache::vhost_base { "maintdb.$domain":
- location => $maintdb_dbdir,
- content => template("buildsystem/vhost_maintdb.conf"),
- }
- }
-
class binrepo inherits base {
include sudo
$binrepo_login = "binrepo"
diff --git a/modules/buildsystem/manifests/maintdb.pp b/modules/buildsystem/manifests/maintdb.pp
new file mode 100644
index 00000000..3e231745
--- /dev/null
+++ b/modules/buildsystem/manifests/maintdb.pp
@@ -0,0 +1,71 @@
+class buildsystem {
+ class maintdb inherits base {
+ include sudo
+ $maintdb_login = "maintdb"
+ $maintdb_homedir = "/var/lib/maintdb"
+ $maintdb_dbdir = "$maintdb_homedir/db"
+ $maintdb_binpath = "/usr/local/sbin/maintdb"
+ $maintdb_wrappath = "/usr/local/bin/wrapper.maintdb"
+ $maintdb_dump = "/var/www/bs/data/maintdb.txt"
+ $maintdb_unmaintained = "/var/www/bs/data/unmaintained.txt"
+
+ user {"$maintdb_login":
+ ensure => present,
+ comment => "Maintainers database",
+ managehome => true,
+ shell => "/bin/bash",
+ home => "$maintdb_homedir",
+ }
+
+ file { "$maintdb_homedir":
+ ensure => directory,
+ owner => "$maintdb_login",
+ group => "$maintdb_login",
+ mode => 711,
+ require => User["$maintdb_login"],
+ }
+
+ file { "$maintdb_dbdir":
+ ensure => directory,
+ owner => "$maintdb_login",
+ group => "$maintdb_login",
+ mode => 711,
+ require => User["$maintdb_login"],
+ }
+
+ file { "$maintdb_binpath":
+ mode => 755,
+ content => template("buildsystem/maintdb")
+ }
+
+ file { "$maintdb_wrappath":
+ mode => 755,
+ content => template("buildsystem/wrapper.maintdb")
+ }
+
+ sudo::sudoers_config { "maintdb":
+ content => template("buildsystem/sudoers.maintdb")
+ }
+
+ file { ["$maintdb_dump","$maintdb_dump.new",
+ "$maintdb_unmaintained","$maintdb_unmaintained.new"]:
+ ensure => present,
+ owner => $maintdb_login,
+ mode => 644,
+ require => File["/var/www/bs/data"],
+ }
+
+ cron { "update maintdb export":
+ user => $maintdb_login,
+ command => "$maintdb_binpath root get > $maintdb_dump.new; mv -f $maintdb_dump.new $maintdb_dump; grep ' nobody\$' $maintdb_dump | sed 's/ nobody\$//' > $maintdb_unmaintained.new; mv -f $maintdb_unmaintained.new $maintdb_unmaintained",
+ minute => "*/30",
+ require => User[$maintdb_login],
+ }
+
+ apache::vhost_base { "maintdb.$domain":
+ location => $maintdb_dbdir,
+ content => template("buildsystem/vhost_maintdb.conf"),
+ }
+ }
+}
+
diff --git a/modules/buildsystem/templates/sudoers.maintdb b/modules/buildsystem/templates/sudoers.maintdb
index 26e8a26d..7503eae4 100644
--- a/modules/buildsystem/templates/sudoers.maintdb
+++ b/modules/buildsystem/templates/sudoers.maintdb
@@ -1,2 +1,2 @@
-%<%= packagers_group %> ALL =(<%= maintdb_login %>) NOPASSWD: <%= maintdb_binpath %>
-<%= sched_login %> ALL =(<%= maintdb_login %>) NOPASSWD: <%= maintdb_binpath %>
+%<%= scope.lookupvar('buildsystem::base::packagers_group') %> ALL =(<%= maintdb_login %>) NOPASSWD: <%= maintdb_binpath %>
+<%= scope.lookupvar('buildsystem::base::sched_login') %> ALL =(<%= maintdb_login %>) NOPASSWD: <%= maintdb_binpath %>
diff --git a/modules/buildsystem/templates/wrapper.maintdb b/modules/buildsystem/templates/wrapper.maintdb
index 2f6e2324..a1ebf1f0 100644
--- a/modules/buildsystem/templates/wrapper.maintdb
+++ b/modules/buildsystem/templates/wrapper.maintdb
@@ -2,7 +2,7 @@
maintdbuser="<%= maintdb_login %>"
maintdbpath="<%= maintdb_binpath %>"
-packagersgroup="<%= packagers_group %>"
+packagersgroup="<%= scope.lookupvar('buildsystem::base::packagers_group') %>"
function isingroup()
{