OLD | NEW |
1 class downloadserver { | 1 class downloadserver( |
| 2 $domain, |
| 3 $is_default = false |
| 4 ) { |
| 5 |
2 class {'nginx': | 6 class {'nginx': |
3 worker_processes => 2, | 7 worker_processes => 2, |
4 worker_connections => 4000, | 8 worker_connections => 4000, |
5 ssl_session_cache => off, | 9 ssl_session_cache => off, |
6 } | 10 } |
7 | 11 |
8 user {'hg': | 12 user {'hg': |
9 ensure => present, | 13 ensure => present, |
10 comment => 'Mercurial client user', | 14 comment => 'Mercurial client user', |
11 home => '/home/hg', | 15 home => '/home/hg', |
(...skipping 14 matching lines...) Expand all Loading... |
26 timeout => 0, | 30 timeout => 0, |
27 onlyif => "test ! -d /var/www/downloads" | 31 onlyif => "test ! -d /var/www/downloads" |
28 } | 32 } |
29 | 33 |
30 File { | 34 File { |
31 owner => root, | 35 owner => root, |
32 group => root, | 36 group => root, |
33 mode => 0644, | 37 mode => 0644, |
34 } | 38 } |
35 | 39 |
36 file {'/etc/nginx/sites-available/adblockplus.org_sslcert.key': | 40 nginx::hostconfig{$domain: |
37 ensure => file, | 41 source => 'puppet:///modules/downloadserver/site.conf', |
38 notify => Service['nginx'], | 42 is_default => $is_default, |
39 before => Nginx::Hostconfig['downloads.adblockplus.org'], | 43 certificate => 'adblockplus.org_sslcert.pem', |
40 mode => 0400, | 44 private_key => 'adblockplus.org_sslcert.key', |
41 source => 'puppet:///modules/private/adblockplus.org_sslcert.key' | 45 log => 'access_log_downloads' |
42 } | |
43 | |
44 file {'/etc/nginx/sites-available/adblockplus.org_sslcert.pem': | |
45 ensure => file, | |
46 notify => Service['nginx'], | |
47 before => Nginx::Hostconfig['downloads.adblockplus.org'], | |
48 mode => 0400, | |
49 source => 'puppet:///modules/private/adblockplus.org_sslcert.pem' | |
50 } | |
51 | |
52 nginx::hostconfig{'downloads.adblockplus.org': | |
53 source => 'puppet:///modules/downloadserver/downloads.adblockplus.org', | |
54 enabled => true | |
55 } | |
56 | |
57 file {'/etc/logrotate.d/nginx_downloads.adblockplus.org': | |
58 ensure => file, | |
59 mode => 0444, | |
60 require => Nginx::Hostconfig['downloads.adblockplus.org'], | |
61 source => 'puppet:///modules/downloadserver/logrotate' | |
62 } | 46 } |
63 | 47 |
64 cron {'mirror': | 48 cron {'mirror': |
65 ensure => present, | 49 ensure => present, |
66 command => 'hg pull -q -u -R /var/www/downloads/', | 50 command => 'hg pull -q -u -R /var/www/downloads/', |
67 environment => ['MAILTO=admins@adblockplus.org,root'], | 51 environment => ['MAILTO=admins@adblockplus.org,root'], |
68 user => hg, | 52 user => hg, |
69 minute => '*/10' | 53 minute => '*/10' |
70 } | 54 } |
71 | 55 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 require => [File['/home/rsync/.ssh/known_hosts'], | 97 require => [File['/home/rsync/.ssh/known_hosts'], |
114 File['/home/rsync/.ssh/id_rsa'], | 98 File['/home/rsync/.ssh/id_rsa'], |
115 File['/var/www/devbuilds']], | 99 File['/var/www/devbuilds']], |
116 command => 'rsync -e ssh -ltprz --delete devbuilds@ssh.adblockplus.org:. /va
r/www/devbuilds', | 100 command => 'rsync -e ssh -ltprz --delete devbuilds@ssh.adblockplus.org:. /va
r/www/devbuilds', |
117 environment => ['MAILTO=admins@adblockplus.org,root'], | 101 environment => ['MAILTO=admins@adblockplus.org,root'], |
118 user => rsync, | 102 user => rsync, |
119 hour => '*', | 103 hour => '*', |
120 minute => '4-54/10' | 104 minute => '4-54/10' |
121 } | 105 } |
122 } | 106 } |
OLD | NEW |