OLD | NEW |
1 class web::server( | 1 class web::server( |
2 $vhost, | 2 $vhost, |
3 $repository, | 3 $repository, |
| 4 $remote = "https://hg.adblockplus.org/${repository}", |
4 $certificate = hiera('web::server::certificate', 'undef'), | 5 $certificate = hiera('web::server::certificate', 'undef'), |
5 $private_key = hiera('web::server::private_key', 'undef'), | 6 $private_key = hiera('web::server::private_key', 'undef'), |
6 $is_default = false, | 7 $is_default = false, |
7 $aliases = undef, | 8 $aliases = undef, |
8 $custom_config = undef, | 9 $custom_config = undef, |
9 $multiplexer_locations = undef, | 10 $multiplexer_locations = undef, |
10 $geoip = false, | 11 $geoip = false, |
11 ) { | 12 ) { |
12 | 13 |
13 include sitescripts | 14 include sitescripts |
14 include adblockplus::web | 15 include adblockplus::web |
| 16 include adblockplus::mercurial |
15 | 17 |
16 $pythonpath = 'PYTHONPATH=/opt/cms:/opt/sitescripts' | 18 $pythonpath = 'PYTHONPATH=/opt/cms:/opt/sitescripts' |
17 | 19 |
18 # Ensure there is at least one character in the respective strings; | 20 # Ensure there is at least one character in the respective strings; |
19 # see https://codereview.adblockplus.org/29329028/#msg3 | 21 # see https://codereview.adblockplus.org/29329028/#msg3 |
20 validate_re($vhost, '.+') | 22 validate_re($vhost, '.+') |
21 validate_re($repository, '.+') | 23 validate_re($repository, '.+') |
22 | 24 |
23 File { | 25 File { |
24 owner => 'root', | 26 owner => 'root', |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 'https://hg.adblockplus.org/cms/', | 107 'https://hg.adblockplus.org/cms/', |
106 '/opt/cms', | 108 '/opt/cms', |
107 ] | 109 ] |
108 | 110 |
109 Exec { | 111 Exec { |
110 path => ["/usr/bin/", "/bin/"], | 112 path => ["/usr/bin/", "/bin/"], |
111 } | 113 } |
112 | 114 |
113 exec {"fetch_cms": | 115 exec {"fetch_cms": |
114 command => shellquote($fetch_cms_cmd), | 116 command => shellquote($fetch_cms_cmd), |
115 require => Package['mercurial'], | 117 require => Class['adblockplus::mercurial'], |
116 timeout => 0, | 118 timeout => 0, |
117 creates => "/opt/cms/.hg/hgrc", | 119 creates => "/opt/cms/.hg/hgrc", |
118 } | 120 } |
119 | 121 |
120 $fetch_repo_cmd = [ | 122 $fetch_repo_cmd = [ |
121 'hg', 'clone', | 123 'hg', 'clone', |
122 '--noupdate', | 124 '--noupdate', |
123 "https://hg.adblockplus.org/${repository}", | 125 $remote, |
124 "/home/www/${repository}", | 126 "/home/www/${repository}", |
125 ] | 127 ] |
126 | 128 |
127 exec {"fetch_repo": | 129 exec {"fetch_repo": |
128 command => shellquote($fetch_repo_cmd), | 130 command => shellquote($fetch_repo_cmd), |
129 require => Package['mercurial'], | 131 require => Class['adblockplus::mercurial'], |
130 user => www, | 132 user => www, |
131 timeout => 0, | 133 timeout => 0, |
132 creates => "/home/www/${repository}/.hg/hgrc", | 134 creates => "/home/www/${repository}/.hg/hgrc", |
133 } | 135 } |
134 | 136 |
135 $initialize_content_exec = [ | 137 $initialize_content_exec = [ |
136 'python', '-m', 'cms.bin.generate_static_pages', | 138 'python', '-m', 'cms.bin.generate_static_pages', |
137 "/home/www/${repository}", "/var/www/${vhost}", | 139 "/home/www/${repository}", "/var/www/${vhost}", |
138 ] | 140 ] |
139 | 141 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 ) | 185 ) |
184 | 186 |
185 cron {'update_repo': | 187 cron {'update_repo': |
186 ensure => present, | 188 ensure => present, |
187 command => $update_webpage_cmd, | 189 command => $update_webpage_cmd, |
188 user => www, | 190 user => www, |
189 minute => '5-59/20', | 191 minute => '5-59/20', |
190 } | 192 } |
191 | 193 |
192 } | 194 } |
OLD | NEW |