1 |
class buildsystem::maintdb { |
2 |
include buildsystem::var::maintdb |
3 |
include buildsystem::var::groups |
4 |
include buildsystem::var::webstatus |
5 |
include sudo |
6 |
|
7 |
user { $buildsystem::var::maintdb::login: |
8 |
comment => 'Maintainers database', |
9 |
home => $buildsystem::var::maintdb::homedir, |
10 |
} |
11 |
|
12 |
file { [$buildsystem::var::maintdb::homedir,$buildsystem::var::maintdb::dbdir]: |
13 |
ensure => directory, |
14 |
owner => $buildsystem::var::maintdb::login, |
15 |
group => $buildsystem::var::maintdb::login, |
16 |
mode => '0711', |
17 |
require => User[$buildsystem::var::maintdb::login], |
18 |
} |
19 |
|
20 |
file { $buildsystem::var::maintdb::binpath: |
21 |
mode => '0755', |
22 |
content => template('buildsystem/maintdb/maintdb.bin') |
23 |
} |
24 |
|
25 |
mga_common::local_script { 'wrapper.maintdb': |
26 |
content => template('buildsystem/maintdb/wrapper.maintdb') |
27 |
} |
28 |
|
29 |
sudo::sudoers_config { 'maintdb': |
30 |
content => template('buildsystem/maintdb/sudoers.maintdb') |
31 |
} |
32 |
|
33 |
file { [$buildsystem::var::maintdb::dump, |
34 |
"${buildsystem::var::maintdb::dump}.new", |
35 |
$buildsystem::var::maintdb::unmaintained, |
36 |
"${buildsystem::var::maintdb::unmaintained}.new"]: |
37 |
owner => $buildsystem::var::maintdb::login, |
38 |
require => File["${buildsystem::var::webstatus::location}/data"], |
39 |
} |
40 |
|
41 |
cron { 'update maintdb export': |
42 |
user => $buildsystem::var::maintdb::login, |
43 |
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}", |
44 |
minute => '*/30', |
45 |
require => User[$buildsystem::var::maintdb::login], |
46 |
} |
47 |
|
48 |
apache::vhost::base { $buildsystem::var::maintdb::hostname: |
49 |
location => $buildsystem::var::maintdb::dbdir, |
50 |
content => template('buildsystem/maintdb/vhost_maintdb.conf'), |
51 |
} |
52 |
} |