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

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

Issue 29440592: Noissue - Configure common $path for web::server exec resources (Closed)
Patch Set: Created May 17, 2017, 5:50 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,
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 home => '/home/www', 98 home => '/home/www',
99 managehome => true, 99 managehome => true,
100 } 100 }
101 101
102 $fetch_cms_cmd = [ 102 $fetch_cms_cmd = [
103 'hg', 'clone', 103 'hg', 'clone',
104 'https://hg.adblockplus.org/cms/', 104 'https://hg.adblockplus.org/cms/',
105 '/opt/cms', 105 '/opt/cms',
106 ] 106 ]
107 107
108 Exec {
109 path => ["/usr/bin/", "/bin/"],
110 }
111
108 exec {"fetch_cms": 112 exec {"fetch_cms":
109 command => shellquote($fetch_cms_cmd), 113 command => shellquote($fetch_cms_cmd),
110 path => ["/usr/bin/", "/bin/"],
111 require => Package['mercurial'], 114 require => Package['mercurial'],
112 timeout => 0, 115 timeout => 0,
113 creates => "/opt/cms/.hg/hgrc", 116 creates => "/opt/cms/.hg/hgrc",
114 } 117 }
115 118
116 $fetch_repo_cmd = [ 119 $fetch_repo_cmd = [
117 'hg', 'clone', 120 'hg', 'clone',
118 '--noupdate', 121 '--noupdate',
119 "https://hg.adblockplus.org/${repository}", 122 "https://hg.adblockplus.org/${repository}",
120 "/home/www/${repository}", 123 "/home/www/${repository}",
121 ] 124 ]
122 125
123 exec {"fetch_repo": 126 exec {"fetch_repo":
124 command => shellquote($fetch_repo_cmd), 127 command => shellquote($fetch_repo_cmd),
125 path => ["/usr/bin/", "/bin/"],
126 require => Package['mercurial'], 128 require => Package['mercurial'],
127 user => www, 129 user => www,
128 timeout => 0, 130 timeout => 0,
129 creates => "/home/www/${repository}/.hg/hgrc", 131 creates => "/home/www/${repository}/.hg/hgrc",
130 } 132 }
131 133
132 $initialize_content_exec = [ 134 $initialize_content_exec = [
133 'python', '-m', 'cms.bin.generate_static_pages', 135 'python', '-m', 'cms.bin.generate_static_pages',
134 "/home/www/${repository}", "/var/www/${vhost}", 136 "/home/www/${repository}", "/var/www/${vhost}",
135 ] 137 ]
136 138
137 exec {"initialize_content": 139 exec {"initialize_content":
138 command => shellquote($initialize_content_exec), 140 command => shellquote($initialize_content_exec),
139 path => ["/usr/bin/", "/bin/"],
140 user => www, 141 user => www,
141 subscribe => [Exec["fetch_repo"], Exec["fetch_cms"]], 142 subscribe => [Exec["fetch_repo"], Exec["fetch_cms"]],
142 refreshonly => true, 143 refreshonly => true,
143 environment => $PYTHONPATH, 144 environment => $PYTHONPATH,
144 } 145 }
145 146
146 file {'/var/www': 147 file {'/var/www':
147 ensure => directory, 148 ensure => directory,
148 mode => 755, 149 mode => 755,
149 } 150 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 ) 187 )
187 188
188 cron {'update_repo': 189 cron {'update_repo':
189 ensure => present, 190 ensure => present,
190 command => $update_webpage_cmd, 191 command => $update_webpage_cmd,
191 user => www, 192 user => www,
192 minute => '5-59/20', 193 minute => '5-59/20',
193 } 194 }
194 195
195 } 196 }
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