aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mga-mirrors/manifests/init.pp
blob: 5b1633ee1d87058940b9e0b67216ee0135c9e106 (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
class mga-mirrors {
    
    $vhost = "mirrors.$domain"

    package { 'mga-mirrors':
        ensure => installed
    }

    apache::vhost_catalyst_app { $vhost:
        vhost => $vhost,
        script => "/usr/bin/mga_mirrors_fastcgi.pl", 
        require => Package['mga-mirrors'],
    }

    apache::vhost_catalyst_app { "ssl_$vhost":
        vhost => $vhost,
        use_ssl => true,
        script => "/usr/bin/mga_mirrors_fastcgi.pl", 
        require => Package['mga-mirrors'],
    }


    $pgsql_password = extlookup("mga_mirror_pgsql",'x')

    postgresql::remote_db_and_user { 'mirrors':
        password => $pgsql_password,
        description => "Mirrors database",
    }
 
    file { "mga-mirrors.ini": 
        path => "/etc/mga-mirrors.ini",    
        ensure => "present",
        owner => root,
        group => apache,
        mode => 640,
        content => template("mga-mirrors/mga-mirrors.ini"),
        require => Package['mga-mirrors']
    }
}