1 |
class websites { |
2 |
class base { |
3 |
$webdatadir = '/var/www/vhosts' |
4 |
} |
5 |
|
6 |
# vhost to host static files used by web sites |
7 |
class static inherits base { |
8 |
$vhostdir = "$webdatadir/static.$domain" |
9 |
$svn_location = "svn://svn.$domain/svn/web/www/trunk/g/" |
10 |
apache::vhost_other_app { "static.$domain": |
11 |
vhost_file => 'websites/vhost_static.conf', |
12 |
} |
13 |
|
14 |
file { $vhostdir: |
15 |
ensure => directory, |
16 |
mode => 655, |
17 |
} |
18 |
|
19 |
subversion::snapshot { "$vhostdir/g": |
20 |
source => $svn_location |
21 |
} |
22 |
} |
23 |
|
24 |
class www inherits base { |
25 |
include apache::mod_php |
26 |
include apache::mod_geoip |
27 |
$vhostdir = "$webdatadir/www.$domain" |
28 |
$svn_location = "svn://svn.$domain/svn/web/www/trunk" |
29 |
|
30 |
subversion::snapshot { $vhostdir: |
31 |
source => $svn_location |
32 |
} |
33 |
|
34 |
apache::vhost_base { "www-test.$domain": |
35 |
content => template('websites/vhost_www.conf'), |
36 |
} |
37 |
|
38 |
package { ['php-mbstring', 'php-mcrypt', 'php-gettext']: |
39 |
ensure => "installed", |
40 |
} |
41 |
} |
42 |
|
43 |
class hugs inherits base { |
44 |
$vhostdir = "$webdatadir/hugs.$domain" |
45 |
$svn_location = "svn://svn.$domain/svn/web/hugs/public/" |
46 |
apache::vhost_base { "hugs.$domain": |
47 |
location => $vhostdir, |
48 |
} |
49 |
|
50 |
subversion::snapshot { "$vhostdir": |
51 |
source => $svn_location |
52 |
} |
53 |
|
54 |
package { php-exif: |
55 |
ensure => "installed", |
56 |
} |
57 |
} |
58 |
|
59 |
class releases inherits base { |
60 |
$vhostdir = "$webdatadir/releases.$domain" |
61 |
$svn_location = "svn://svn.$domain/svn/web/releases/" |
62 |
apache::vhost_base { "releases.$domain": |
63 |
location => $vhostdir, |
64 |
options => [ "FollowSymLinks" ] |
65 |
} |
66 |
apache::vhost_base { "ssl_releases.$domain": |
67 |
vhost => "releases.$domain", |
68 |
use_ssl => true, |
69 |
location => $vhostdir, |
70 |
options => [ "FollowSymLinks" ] |
71 |
} |
72 |
|
73 |
subversion::snapshot { "$vhostdir": |
74 |
source => $svn_location |
75 |
} |
76 |
} |
77 |
|
78 |
class www_outage { |
79 |
apache::vhost_redirect { "www.$domain": |
80 |
url => 'http://blog.mageia.org/en/2011/12/19/server-outage/#' |
81 |
} |
82 |
apache::vhost_redirect { "$domain": |
83 |
url => 'http://blog.mageia.org/en/2011/12/19/server-outage/#' |
84 |
} |
85 |
} |
86 |
|
87 |
class svn { |
88 |
apache::vhost_redirect { "svn.$domain": |
89 |
url => "http://svnweb.$domain/", |
90 |
} |
91 |
} |
92 |
|
93 |
class forum_proxy { |
94 |
|
95 |
$web_domain = "forums.$domain" |
96 |
host { "$web_domain": |
97 |
ip => '192.168.122.131', |
98 |
ensure => 'present', |
99 |
} |
100 |
|
101 |
apache::vhost_reverse_proxy { "$web_domain": |
102 |
url => "http://$web_domain/", |
103 |
} |
104 |
|
105 |
apache::vhost_reverse_proxy { "ssl_$web_domain": |
106 |
vhost => $web_domain, |
107 |
use_ssl => true, |
108 |
url => "http://$web_domain/", |
109 |
} |
110 |
} |
111 |
|
112 |
class pkgcpan inherits base { |
113 |
$vhost = "pkgcpan.$domain" |
114 |
$vhostdir = "$webdatadir/$vhost" |
115 |
|
116 |
apache::vhost_base { "$vhost": |
117 |
location => $vhostdir, |
118 |
options => [ "Indexes" ] |
119 |
} |
120 |
|
121 |
file { $vhostdir: |
122 |
ensure => directory, |
123 |
} |
124 |
|
125 |
package { "perl-Module-Packaged-Generator": |
126 |
ensure => installed, |
127 |
} |
128 |
|
129 |
cron { "update cpanpkg": |
130 |
hour => 23, |
131 |
require => Package['perl-Module-Packaged-Generator'], |
132 |
command => "pkgcpan -q -f $vhostdir/cpan_Mageia.db -d Mageia", |
133 |
} |
134 |
} |
135 |
} |