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

Delta Between Two Patch Sets: modules/web/manifests/server.pp

Issue 29329028: Issue 3190 - Ensure /var/cache/$cms_repository being present and writable (Closed)
Left Patch Set: Created Oct. 9, 2015, 7:28 p.m.
Right Patch Set: Issue 3190 - Address feedback from codereview Created Oct. 12, 2015, 1:32 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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, 10 $geoip = false,
11 ) { 11 ) {
12
13 # Ensure there is at least one character in the respective strings;
14 # see https://codereview.adblockplus.org/29329028/#msg3
15 validate_re($vhost, '.+')
16 validate_re($repository, '.+')
12 17
13 File { 18 File {
14 owner => 'root', 19 owner => 'root',
15 group => 'root', 20 group => 'root',
16 mode => 0644, 21 mode => 0644,
17 } 22 }
18 23
19 Cron { 24 Cron {
20 environment => ['MAILTO=admins@adblockplus.org', 'PYTHONPATH=/opt/cms:/opt/s itescripts'], 25 environment => ['MAILTO=admins@adblockplus.org', 'PYTHONPATH=/opt/cms:/opt/s itescripts'],
21 } 26 }
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 onlyif => "test ! -d /home/www/${repository}", 94 onlyif => "test ! -d /home/www/${repository}",
90 } 95 }
91 96
92 file {'/var/www': 97 file {'/var/www':
93 ensure => directory, 98 ensure => directory,
94 mode => 755, 99 mode => 755,
95 } 100 }
96 101
97 file {[ 102 file {[
98 "/var/cache/${repository}", 103 "/var/cache/${repository}",
99 "/var/www/${vhost}", 104 "/var/www/${vhost}",
Fred 2015/10/12 13:07:48 Are the variables $repository and $vhost guarantee
mathias 2015/10/12 13:18:36 Neither by code, nor by documentation. By conventi
100 ]: 105 ]:
101 ensure => directory, 106 ensure => directory,
102 owner => www, 107 owner => www,
103 mode => 755, 108 mode => 755,
104 } 109 }
105 110
106 cron {'update_cms': 111 cron {'update_cms':
107 ensure => present, 112 ensure => present,
108 command => "hg pull -q -u -R /opt/cms", 113 command => "hg pull -q -u -R /opt/cms",
109 minute => '5-55/10', 114 minute => '5-55/10',
110 } 115 }
111 116
112 cron {'update_repo': 117 cron {'update_repo':
113 ensure => present, 118 ensure => present,
114 command => "hg pull -q -R /home/www/${repository} && python -m cms.bin.gener ate_static_pages /home/www/${repository} /var/www/${vhost}", 119 command => "hg pull -q -R /home/www/${repository} && python -m cms.bin.gener ate_static_pages /home/www/${repository} /var/www/${vhost}",
115 user => www, 120 user => www,
116 minute => '*/10', 121 minute => '*/10',
117 } 122 }
118 } 123 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld