1 |
class mgapeople( |
2 |
$site_name = 'people.mageia.org', |
3 |
$groupbase = 'ou=Group,dc=mageia,dc=org', |
4 |
$maintdburl = undef, |
5 |
$ldap_server, |
6 |
$binddn, |
7 |
$bindpw, |
8 |
$vhost, |
9 |
$vhostdir |
10 |
){ |
11 |
$mgapeople_login = 'mgapeople' |
12 |
$bindpw_file = '/etc/mgapeople.ldapsecret' |
13 |
|
14 |
group { $mgapeople_login: |
15 |
ensure => present, |
16 |
} |
17 |
|
18 |
user { $mgapeople_login: |
19 |
ensure => present, |
20 |
comment => 'mgapeople user', |
21 |
home => "/var/lib/${mgapeople_login}", |
22 |
managehome => true, |
23 |
gid => $mgapeople_login, |
24 |
} |
25 |
|
26 |
file { $bindpw_file: |
27 |
ensure => present, |
28 |
owner => $mgapeople_login, |
29 |
group => $mgapeople_login, |
30 |
mode => '0600', |
31 |
content => $bindpw, |
32 |
} |
33 |
|
34 |
package { 'mgapeople': |
35 |
ensure => installed, |
36 |
} |
37 |
|
38 |
file {'/etc/mgapeople.conf': |
39 |
ensure => present, |
40 |
owner => root, |
41 |
group => root, |
42 |
mode => '0644', |
43 |
content => template('mgapeople/mgapeople.conf'), |
44 |
require => Package['mgapeople'], |
45 |
} |
46 |
|
47 |
file { $vhostdir: |
48 |
ensure => directory, |
49 |
owner => $mgapeople_login, |
50 |
group => $mgapeople_login, |
51 |
mode => '0755', |
52 |
} |
53 |
|
54 |
$vhost_aliases = { |
55 |
'/static' => '/usr/share/mgapeople/static', |
56 |
} |
57 |
apache::vhost::base { $vhost: |
58 |
location => $vhostdir, |
59 |
require => File[$vhostdir], |
60 |
aliases => $vhost_aliases, |
61 |
} |
62 |
apache::vhost::base { "ssl_${vhost}": |
63 |
vhost => $vhost, |
64 |
use_ssl => true, |
65 |
location => $vhostdir, |
66 |
require => File[$vhostdir], |
67 |
aliases => $vhost_aliases, |
68 |
} |
69 |
|
70 |
cron { '/usr/bin/mkpeople': |
71 |
command => '/usr/bin/mkpeople', |
72 |
user => $mgapeople_login, |
73 |
hour => '*/2', |
74 |
minute => '10', |
75 |
} |
76 |
} |
77 |
# vim: sw=2 |