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