aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mgapeople/manifests/init.pp
blob: 7c40ab9c40f7d078eade2fa9b82d02c45b86c1d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
class mgapeople(
  $site_name = "people.${::domain}",
  $groupbase = 'ou=Group,dc=mageia,dc=org',
  $maintdburl = undef,
  $ldap_server,
  $binddn,
  $bindpw,
  $vhost,
  $vhostdir
){
  $mgapeople_login = 'mgapeople'
  $bindpw_file = '/etc/mgapeople.ldapsecret'

  group { $mgapeople_login:
    ensure => present,
  }

  user { $mgapeople_login:
    ensure     => present,
    comment    => 'mgapeople user',
    home       => "/var/lib/${mgapeople_login}",
    managehome => true,
    gid        => $mgapeople_login,
  }

  file { $bindpw_file:
    ensure  => present,
    owner   => $mgapeople_login,
    group   => $mgapeople_login,
    mode    => '0600',
    content => $bindpw,
  }

  package { 'mgapeople':
    ensure => installed,
  }

  file {'/etc/mgapeople.conf':
    ensure  => present,
    owner   => root,
    group   => root,
    mode    => '0644',
    content => template('mgapeople/mgapeople.conf'),
    require => Package['mgapeople'],
  }

  file { $vhostdir:
    ensure => directory,
    owner  => $mgapeople_login,
    group  => $mgapeople_login,
    mode   => '0755',
  }

  $vhost_aliases = {
    '/static' => '/usr/share/mgapeople/static',
  }
  apache::vhost::base { $vhost:
    location => $vhostdir,
    require  => File[$vhostdir],
    aliases  => $vhost_aliases,
  }
  apache::vhost::base { "ssl_${vhost}":
    vhost    => $vhost,
    use_ssl  => true,
    location => $vhostdir,
    require  => File[$vhostdir],
    aliases  => $vhost_aliases,
  }

  cron { '/usr/bin/mkpeople':
    command => '/usr/bin/mkpeople',
    user    => $mgapeople_login,
    hour    => '*/2',
    minute  => '10',
  }
}
# vim: sw=2