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

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

Issue 29326153: Issue 3011 - Integrate GeoIP with Nginx configuration (Closed)
Patch Set: Created Sept. 8, 2015, 6:19 p.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 | « modules/nginx/templates/nginx.conf.erb ('k') | no next file » | 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( 1 class web::server(
2 $vhost, 2 $vhost,
3 $repository, 3 $repository,
4 $certificate = hiera('web::server::certificate', 'undef'), 4 $certificate = hiera('web::server::certificate', 'undef'),
5 $private_key = hiera('web::server::private_key', 'undef'), 5 $private_key = hiera('web::server::private_key', 'undef'),
6 $is_default = false, 6 $is_default = false,
7 $aliases = undef, 7 $aliases = undef,
8 $custom_config = undef, 8 $custom_config = undef,
9 $multiplexer_locations = undef) { 9 $multiplexer_locations = undef,
10 $geoip = false,
11 ) {
12
10 File { 13 File {
11 owner => 'root', 14 owner => 'root',
12 group => 'root', 15 group => 'root',
13 mode => 0644, 16 mode => 0644,
14 } 17 }
15 18
16 Cron { 19 Cron {
17 environment => ['MAILTO=admins@adblockplus.org', 'PYTHONPATH=/opt/cms:/opt/s itescripts'], 20 environment => ['MAILTO=admins@adblockplus.org', 'PYTHONPATH=/opt/cms:/opt/s itescripts'],
18 } 21 }
19 22
20 include nginx 23 class {'nginx':
24 geoip_country => $geoip ? {
25 false => undef,
26 default => '/usr/share/GeoIP/GeoIPv6.dat',
27 },
28 }
29
30 class {'geoip':
31 cron => {hour => 0, minute => 8, monthday => 15},
32 ensure => $geoip ? {false => 'absent', default => 'present'},
33 }
21 34
22 package {['python-jinja2', 'python-markdown']:} 35 package {['python-jinja2', 'python-markdown']:}
23 36
24 nginx::hostconfig {$vhost: 37 nginx::hostconfig {$vhost:
25 content => template('web/site.conf.erb'), 38 content => template('web/site.conf.erb'),
26 global_config => template('web/global.conf.erb'), 39 global_config => template('web/global.conf.erb'),
27 is_default => $is_default, 40 is_default => $is_default,
28 certificate => $certificate ? {'undef' => undef, default => $certificate}, 41 certificate => $certificate ? {'undef' => undef, default => $certificate},
29 private_key => $private_key ? {'undef' => undef, default => $private_key}, 42 private_key => $private_key ? {'undef' => undef, default => $private_key},
30 log => "access_log_$vhost" 43 log => "access_log_$vhost"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 minute => '5-55/10', 106 minute => '5-55/10',
94 } 107 }
95 108
96 cron {'update_repo': 109 cron {'update_repo':
97 ensure => present, 110 ensure => present,
98 command => "hg pull -q -R /home/www/${repository} && python -m cms.bin.gener ate_static_pages /home/www/${repository} /var/www/${vhost}", 111 command => "hg pull -q -R /home/www/${repository} && python -m cms.bin.gener ate_static_pages /home/www/${repository} /var/www/${vhost}",
99 user => www, 112 user => www,
100 minute => '*/10', 113 minute => '*/10',
101 } 114 }
102 } 115 }
OLDNEW
« no previous file with comments | « modules/nginx/templates/nginx.conf.erb ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld