Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: modules/web/manifests/server.pp

Issue 4884212985364480: Allow running multiplexer on web servers (Closed)
Patch Set: Created Dec. 18, 2013, 7:02 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « manifests/webserver.pp ('k') | modules/web/templates/site.erb » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 class web::server($vhost, $repository) { 1 class web::server($vhost, $repository, $multiplexer_locations = undef) {
2 File { 2 File {
3 owner => 'root', 3 owner => 'root',
4 group => 'root', 4 group => 'root',
5 mode => 0644, 5 mode => 0644,
6 } 6 }
7 7
8 Cron { 8 Cron {
9 environment => ['MAILTO=admin@adblockplus.org', 'PYTHONPATH=/opt/sitescripts '], 9 environment => ['MAILTO=admin@adblockplus.org', 'PYTHONPATH=/opt/sitescripts '],
10 } 10 }
11 11
(...skipping 17 matching lines...) Expand all
29 ensure => file, 29 ensure => file,
30 mode => 0400, 30 mode => 0400,
31 require => Nginx::Hostconfig[$vhost], 31 require => Nginx::Hostconfig[$vhost],
32 source => 'puppet:///modules/private/adblockplus.org_sslcert.pem', 32 source => 'puppet:///modules/private/adblockplus.org_sslcert.pem',
33 } 33 }
34 34
35 class {'sitescripts': 35 class {'sitescripts':
36 sitescriptsini_source => 'puppet:///modules/web/sitescripts', 36 sitescriptsini_source => 'puppet:///modules/web/sitescripts',
37 } 37 }
38 38
39 if $multiplexer_locations != undef {
40 include spawn-fcgi
41 package {['python-flup', 'python-mysqldb']:}
42
43 spawn-fcgi::pool {"multiplexer":
44 ensure => present,
45 fcgi_app => '/opt/sitescripts/multiplexer.fcgi',
46 socket => '/tmp/multiplexer-fastcgi.sock',
47 mode => '0666',
48 user => 'nginx',
49 children => 1,
50 require => [
51 Exec["fetch_sitescripts"],
52 Package["python-flup"],
53 Package["python-mysqldb"],
54 ],
55 }
56 }
57
39 user {'www': 58 user {'www':
40 ensure => present, 59 ensure => present,
41 comment => 'Web content owner', 60 comment => 'Web content owner',
42 home => '/home/www', 61 home => '/home/www',
43 managehome => true, 62 managehome => true,
44 } 63 }
45 64
46 exec {"fetch_repo": 65 exec {"fetch_repo":
47 command => "hg clone -U https://hg.adblockplus.org/${repository} /home/www/$ {repository}", 66 command => "hg clone -U https://hg.adblockplus.org/${repository} /home/www/$ {repository}",
48 path => ["/usr/bin/", "/bin/"], 67 path => ["/usr/bin/", "/bin/"],
(...skipping 14 matching lines...) Expand all
63 mode => 755, 82 mode => 755,
64 } 83 }
65 84
66 cron {'update_repo': 85 cron {'update_repo':
67 ensure => present, 86 ensure => present,
68 command => "hg pull -q -R /home/www/${repository} && python -m sitescripts.c ms.bin.generate_static_pages /home/www/${repository} /var/www/${vhost}", 87 command => "hg pull -q -R /home/www/${repository} && python -m sitescripts.c ms.bin.generate_static_pages /home/www/${repository} /var/www/${vhost}",
69 user => www, 88 user => www,
70 minute => '*/10', 89 minute => '*/10',
71 } 90 }
72 } 91 }
OLDNEW
« no previous file with comments | « manifests/webserver.pp ('k') | modules/web/templates/site.erb » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld