1 |
class mga-mirrors { |
2 |
|
3 |
$vhost = "mirrors.$domain" |
4 |
|
5 |
package { 'mga-mirrors': |
6 |
ensure => installed |
7 |
} |
8 |
|
9 |
apache::vhost_catalyst_app { $vhost: |
10 |
vhost => $vhost, |
11 |
script => "/usr/bin/mga_mirrors_fastcgi.pl", |
12 |
require => Package['mga-mirrors'], |
13 |
} |
14 |
|
15 |
apache::vhost_catalyst_app { "ssl_$vhost": |
16 |
vhost => $vhost, |
17 |
use_ssl => true, |
18 |
script => "/usr/bin/mga_mirrors_fastcgi.pl", |
19 |
require => Package['mga-mirrors'], |
20 |
} |
21 |
|
22 |
|
23 |
$pgsql_password = extlookup("mga_mirror_pgsql",'x') |
24 |
|
25 |
postgresql::remote_db_and_user { 'mirrors': |
26 |
password => $pgsql_password, |
27 |
description => "Mirrors database", |
28 |
} |
29 |
|
30 |
file { "mga-mirrors.ini": |
31 |
path => "/etc/mga-mirrors.ini", |
32 |
ensure => "present", |
33 |
owner => root, |
34 |
group => apache, |
35 |
mode => 640, |
36 |
content => template("mga-mirrors/mga-mirrors.ini"), |
37 |
require => Package['mga-mirrors'] |
38 |
} |
39 |
} |