aboutsummaryrefslogtreecommitdiffstats
path: root/modules/buildsystem/manifests/maintdb.pp
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/manifests/maintdb.pp
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/manifests/maintdb.pp')
-rw-r--r--modules/buildsystem/manifests/maintdb.pp71
1 files changed, 71 insertions, 0 deletions
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"),
+ }
+ }
+}
+