aboutsummaryrefslogtreecommitdiffstats
path: root/modules/viewvc/manifests/init.pp
blob: 2545a8b13dffa9ddb615ff6722f27313499a6197 (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
class viewvc {
    include apache::mod::fastcgi
    include viewvc::var
    package {['viewvc',
              'python-svn',
              'python-flup']: }

    # http_expiration_time = 600
    # svn_roots = admin: svn://svn.mageia.org/svn/adm/

    file { '/etc/viewvc/viewvc.conf':
        content => template($viewvc::var::tmpl_viewvc_conf),
        notify  => Service['apache'],
        require => Package['viewvc'],
    }

    apache::webapp_other { 'viewvc':
        webapp_file => 'viewvc/webapp.conf',
    }

    mga_common::local_script { 'kill_viewvc':
        content => template('viewvc/kill_viewvc.sh'),
    }

    cron { 'kill_viewvc':
        command     => '/usr/local/bin/kill_viewvc',
        hour        => '*',
        minute      => '*/5',
        user        => 'apache',
        environment => 'MAILTO=root',
    }

    $robotsfile = '/var/www/viewvc/robots.txt'
    file { $robotsfile:
        ensure => present,
        mode   => '0644',
        owner  => root,
        group  => root,
        source => 'puppet:///modules/viewvc/robots.txt',
    }

    $vhost_aliases = {
        '/viewvc' => '/var/www/viewvc/',
        '/robots.txt' => $robotsfile,
        '/'       => '/usr/share/viewvc/bin/wsgi/viewvc.fcgi/'
    }
    apache::vhost::base { $viewvc::var::hostname:
        aliases => $vhost_aliases,
        content => template('viewvc/vhost.conf'),
    }
    apache::vhost::base { "ssl_${viewvc::var::hostname}":
        vhost   => $viewvc::var::hostname,
        use_ssl => true,
        aliases => $vhost_aliases,
    }
}