diff options
Diffstat (limited to 'modules/buildsystem/manifests/maintdb.pp')
| -rw-r--r-- | modules/buildsystem/manifests/maintdb.pp | 54 |
1 files changed, 29 insertions, 25 deletions
diff --git a/modules/buildsystem/manifests/maintdb.pp b/modules/buildsystem/manifests/maintdb.pp index 02782271..5a961b63 100644 --- a/modules/buildsystem/manifests/maintdb.pp +++ b/modules/buildsystem/manifests/maintdb.pp @@ -1,31 +1,27 @@ class buildsystem::maintdb { + include buildsystem::var::maintdb + include buildsystem::var::groups + include buildsystem::var::webstatus include sudo - $login = 'maintdb' - $homedir = '/var/lib/maintdb' - $dbdir = "$homedir/db" - $binpath = '/usr/local/sbin/maintdb' - $dump = '/var/www/bs/data/maintdb.txt' - $unmaintained = '/var/www/bs/data/unmaintained.txt' - user { $login: - comment => 'Maintainers database', - home => $homedir, + user { $buildsystem::var::maintdb::login: + home => $buildsystem::var::maintdb::homedir, } - file { [$homedir,$dbdir]: + file { [$buildsystem::var::maintdb::homedir,$buildsystem::var::maintdb::dbdir]: ensure => directory, - owner => $login, - group => $login, + owner => $buildsystem::var::maintdb::login, + group => $buildsystem::var::maintdb::login, mode => '0711', - require => User[$login], + require => User[$buildsystem::var::maintdb::login], } - file { $binpath: + file { $buildsystem::var::maintdb::binpath: mode => '0755', content => template('buildsystem/maintdb/maintdb.bin') } - mga-common::local_script { 'wrapper.maintdb': + mga_common::local_script { 'wrapper.maintdb': content => template('buildsystem/maintdb/wrapper.maintdb') } @@ -33,22 +29,30 @@ class buildsystem::maintdb { content => template('buildsystem/maintdb/sudoers.maintdb') } - file { [$dump,"$dump.new", - $unmaintained,"$unmaintained.new"]: - owner => $login, -# TODO uncomment once the situation with pkgsubmit module is cleared ( ie, maintdb depend on it ) -# require => File['/var/www/bs/data'], + file { [$buildsystem::var::maintdb::dump, + "${buildsystem::var::maintdb::dump}.new", + $buildsystem::var::maintdb::unmaintained, + "${buildsystem::var::maintdb::unmaintained}.new"]: + owner => $buildsystem::var::maintdb::login, + require => File["${buildsystem::var::webstatus::location}/data"], } cron { 'update maintdb export': - user => $login, - command => "$binpath root get > $dump.new; cp -f $dump.new $dump; grep ' nobody\$' $dump | sed 's/ nobody\$//' > $unmaintained.new; cp -f $unmaintained.new $unmaintained", + user => $buildsystem::var::maintdb::login, + command => "${buildsystem::var::maintdb::binpath} root get > ${buildsystem::var::maintdb::dump}.new; cp -f ${buildsystem::var::maintdb::dump}.new ${buildsystem::var::maintdb::dump}; grep ' nobody\$' ${buildsystem::var::maintdb::dump} | sed 's/ nobody\$//' > ${buildsystem::var::maintdb::unmaintained}.new; cp -f ${buildsystem::var::maintdb::unmaintained}.new ${buildsystem::var::maintdb::unmaintained}", minute => '*/30', - require => User[$login], + require => User[$buildsystem::var::maintdb::login], } - apache::vhost::base { "maintdb.$::domain": - location => $dbdir, + apache::vhost::base { $buildsystem::var::maintdb::hostname: + location => $buildsystem::var::maintdb::dbdir, + content => template('buildsystem/maintdb/vhost_maintdb.conf'), + } + + apache::vhost::base { "ssl_${buildsystem::var::maintdb::hostname}": + use_ssl => true, + vhost => $buildsystem::var::maintdb::hostname, + location => $buildsystem::var::maintdb::dbdir, content => template('buildsystem/maintdb/vhost_maintdb.conf'), } } |
