OLD | NEW |
1 class web::server( | 1 class web::server( |
2 $vhost, | 2 $vhost, |
3 $repository, | 3 $repository, |
4 $is_default = false, | 4 $is_default = false, |
5 $aliases = undef, | 5 $aliases = undef, |
6 $custom_config = undef, | 6 $custom_config = undef, |
7 $multiplexer_locations = undef) { | 7 $multiplexer_locations = undef) { |
8 File { | 8 File { |
9 owner => 'root', | 9 owner => 'root', |
10 group => 'root', | 10 group => 'root', |
11 mode => 0644, | 11 mode => 0644, |
12 } | 12 } |
13 | 13 |
14 Cron { | 14 Cron { |
15 environment => ['MAILTO=admins@adblockplus.org', 'PYTHONPATH=/opt/sitescript
s'], | 15 environment => ['MAILTO=admins@adblockplus.org', 'PYTHONPATH=/opt/sitescript
s'], |
16 } | 16 } |
17 | 17 |
18 include nginx | 18 include nginx |
19 | 19 |
20 package {['python-jinja2', 'python-markdown']:} | 20 package {['python-jinja2', 'python-markdown']:} |
21 | 21 |
22 nginx::hostconfig {$vhost: | 22 nginx::hostconfig {$vhost: |
23 content => template('web/site.erb'), | 23 content => template('web/site.conf.erb'), |
24 enabled => true, | 24 global_config => template('web/global.conf.erb'), |
25 } | 25 is_default => $is_default, |
26 | 26 certificate => 'adblockplus.org_sslcert.pem', |
27 file {'/etc/nginx/sites-available/adblockplus.org_sslcert.key': | 27 private_key => 'adblockplus.org_sslcert.key', |
28 ensure => file, | 28 log => "access_log_$vhost" |
29 mode => 0400, | |
30 require => Nginx::Hostconfig[$vhost], | |
31 source => 'puppet:///modules/private/adblockplus.org_sslcert.key', | |
32 } | |
33 | |
34 file {'/etc/nginx/sites-available/adblockplus.org_sslcert.pem': | |
35 ensure => file, | |
36 mode => 0400, | |
37 require => Nginx::Hostconfig[$vhost], | |
38 source => 'puppet:///modules/private/adblockplus.org_sslcert.pem', | |
39 } | 29 } |
40 | 30 |
41 class {'sitescripts': | 31 class {'sitescripts': |
42 sitescriptsini_source => 'puppet:///modules/web/sitescripts', | 32 sitescriptsini_source => 'puppet:///modules/web/sitescripts', |
43 } | 33 } |
44 | 34 |
45 if $multiplexer_locations != undef { | 35 if $multiplexer_locations != undef { |
46 include spawn-fcgi | 36 include spawn-fcgi |
47 package {['python-flup', 'python-mysqldb']:} | 37 package {['python-flup', 'python-mysqldb']:} |
48 | 38 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 mode => 755, | 78 mode => 755, |
89 } | 79 } |
90 | 80 |
91 cron {'update_repo': | 81 cron {'update_repo': |
92 ensure => present, | 82 ensure => present, |
93 command => "hg pull -q -R /home/www/${repository} && python -m sitescripts.c
ms.bin.generate_static_pages /home/www/${repository} /var/www/${vhost}", | 83 command => "hg pull -q -R /home/www/${repository} && python -m sitescripts.c
ms.bin.generate_static_pages /home/www/${repository} /var/www/${vhost}", |
94 user => www, | 84 user => www, |
95 minute => '*/10', | 85 minute => '*/10', |
96 } | 86 } |
97 } | 87 } |
OLD | NEW |