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

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

Issue 29329028: Issue 3190 - Ensure /var/cache/$cms_repository being present and writable (Closed)
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:
View unified diff | Download patch
« no previous file with comments | « no previous file | 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, 10 $geoip = false,
11 ) { 11 ) {
12 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, '.+')
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 }
22 27
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 user => www, 92 user => www,
88 timeout => 0, 93 timeout => 0,
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 {"/var/www/${vhost}": 102 file {[
103 "/var/cache/${repository}",
104 "/var/www/${vhost}",
105 ]:
98 ensure => directory, 106 ensure => directory,
99 owner => www, 107 owner => www,
100 mode => 755, 108 mode => 755,
101 } 109 }
102 110
103 cron {'update_cms': 111 cron {'update_cms':
104 ensure => present, 112 ensure => present,
105 command => "hg pull -q -u -R /opt/cms", 113 command => "hg pull -q -u -R /opt/cms",
106 minute => '5-55/10', 114 minute => '5-55/10',
107 } 115 }
108 116
109 cron {'update_repo': 117 cron {'update_repo':
110 ensure => present, 118 ensure => present,
111 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}",
112 user => www, 120 user => www,
113 minute => '*/10', 121 minute => '*/10',
114 } 122 }
115 } 123 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld