| OLD | NEW |
| 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 include sitescripts | 13 include sitescripts |
| 14 | 14 |
| 15 $PYTHONPATH = 'PYTHONPATH=/opt/cms:/opt/sitescripts' | 15 $pythonpath = 'PYTHONPATH=/opt/cms:/opt/sitescripts' |
| 16 | 16 |
| 17 # Ensure there is at least one character in the respective strings; | 17 # Ensure there is at least one character in the respective strings; |
| 18 # see https://codereview.adblockplus.org/29329028/#msg3 | 18 # see https://codereview.adblockplus.org/29329028/#msg3 |
| 19 validate_re($vhost, '.+') | 19 validate_re($vhost, '.+') |
| 20 validate_re($repository, '.+') | 20 validate_re($repository, '.+') |
| 21 | 21 |
| 22 File { | 22 File { |
| 23 owner => 'root', | 23 owner => 'root', |
| 24 group => 'root', | 24 group => 'root', |
| 25 mode => 0644, | 25 mode => 0644, |
| 26 } | 26 } |
| 27 | 27 |
| 28 Cron { | 28 Cron { |
| 29 environment => concat(hiera('cron::environment', []), [ | 29 environment => concat(hiera('cron::environment', []), [ |
| 30 $PYTHONPATH, | 30 $pythonpath, |
| 31 ]), | 31 ]), |
| 32 } | 32 } |
| 33 | 33 |
| 34 class {'nginx': | 34 class {'nginx': |
| 35 geoip_country => $geoip ? { | 35 geoip_country => $geoip ? { |
| 36 false => undef, | 36 false => undef, |
| 37 default => '/usr/share/GeoIP/GeoIPv6.dat', | 37 default => '/usr/share/GeoIP/GeoIPv6.dat', |
| 38 }, | 38 }, |
| 39 } | 39 } |
| 40 | 40 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 $initialize_content_exec = [ | 134 $initialize_content_exec = [ |
| 135 'python', '-m', 'cms.bin.generate_static_pages', | 135 'python', '-m', 'cms.bin.generate_static_pages', |
| 136 "/home/www/${repository}", "/var/www/${vhost}", | 136 "/home/www/${repository}", "/var/www/${vhost}", |
| 137 ] | 137 ] |
| 138 | 138 |
| 139 exec {"initialize_content": | 139 exec {"initialize_content": |
| 140 command => shellquote($initialize_content_exec), | 140 command => shellquote($initialize_content_exec), |
| 141 user => www, | 141 user => www, |
| 142 subscribe => [Exec["fetch_repo"], Exec["fetch_cms"]], | 142 subscribe => [Exec["fetch_repo"], Exec["fetch_cms"]], |
| 143 refreshonly => true, | 143 refreshonly => true, |
| 144 environment => $PYTHONPATH, | 144 environment => $pythonpath, |
| 145 } | 145 } |
| 146 | 146 |
| 147 file {'/var/www': | 147 file {'/var/www': |
| 148 ensure => directory, | 148 ensure => directory, |
| 149 mode => 755, | 149 mode => 755, |
| 150 } | 150 } |
| 151 | 151 |
| 152 file {[ | 152 file {[ |
| 153 "/var/cache/$repository", | 153 "/var/cache/$repository", |
| 154 "/var/www/$vhost", | 154 "/var/www/$vhost", |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 ) | 187 ) |
| 188 | 188 |
| 189 cron {'update_repo': | 189 cron {'update_repo': |
| 190 ensure => present, | 190 ensure => present, |
| 191 command => $update_webpage_cmd, | 191 command => $update_webpage_cmd, |
| 192 user => www, | 192 user => www, |
| 193 minute => '5-59/20', | 193 minute => '5-59/20', |
| 194 } | 194 } |
| 195 | 195 |
| 196 } | 196 } |
| OLD | NEW |