| 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 include adblockplus::web | 14 include adblockplus::web |
| 15 include geoip |
| 15 | 16 |
| 16 $remote = hiera('web::server::remote', "https://hg.adblockplus.org/${repositor
y}") | 17 $remote = hiera('web::server::remote', "https://hg.adblockplus.org/${repositor
y}") |
| 17 | 18 |
| 18 $pythonpath = 'PYTHONPATH=/opt/cms:/opt/sitescripts' | 19 $pythonpath = 'PYTHONPATH=/opt/cms:/opt/sitescripts' |
| 19 | 20 |
| 20 # Ensure there is at least one character in the respective strings; | 21 # Ensure there is at least one character in the respective strings; |
| 21 # see https://codereview.adblockplus.org/29329028/#msg3 | 22 # see https://codereview.adblockplus.org/29329028/#msg3 |
| 22 validate_re($vhost, '.+') | 23 validate_re($vhost, '.+') |
| 23 validate_re($repository, '.+') | 24 validate_re($repository, '.+') |
| 24 | 25 |
| 25 File { | 26 File { |
| 26 owner => 'root', | 27 owner => 'root', |
| 27 group => 'root', | 28 group => 'root', |
| 28 mode => '0644', | 29 mode => '0644', |
| 29 } | 30 } |
| 30 | 31 |
| 31 Cron { | 32 Cron { |
| 32 environment => concat(hiera('cron::environment', []), [ | 33 environment => concat(hiera('cron::environment', []), [ |
| 33 $pythonpath, | 34 $pythonpath, |
| 34 ]), | 35 ]), |
| 35 } | 36 } |
| 36 | 37 |
| 37 class {'nginx': | 38 class {'nginx': |
| 38 geoip_country => $geoip ? { | 39 geoip_country => '/usr/share/GeoIP/GeoIPv6.dat', |
| 39 false => undef, | |
| 40 default => '/usr/share/GeoIP/GeoIPv6.dat', | |
| 41 }, | |
| 42 } | |
| 43 | |
| 44 class {'geoip': | |
| 45 cron => {hour => 0, minute => 8, monthday => 15}, | |
| 46 ensure => $geoip ? {false => 'absent', default => 'present'}, | |
| 47 } | 40 } |
| 48 | 41 |
| 49 # Make sure that apt packages corresponding to the pip-installed modules below | 42 # Make sure that apt packages corresponding to the pip-installed modules below |
| 50 # won't be installed unintentionally, these will take precedence otherwise. | 43 # won't be installed unintentionally, these will take precedence otherwise. |
| 51 package {['python-jinja2', 'python-markdown']: | 44 package {['python-jinja2', 'python-markdown']: |
| 52 ensure => 'held', | 45 ensure => 'held', |
| 53 } | 46 } |
| 54 | 47 |
| 55 package {'Jinja2': | 48 package {'Jinja2': |
| 56 ensure => '2.8', | 49 ensure => '2.8', |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 ) | 172 ) |
| 180 | 173 |
| 181 cron {'update_repo': | 174 cron {'update_repo': |
| 182 ensure => present, | 175 ensure => present, |
| 183 command => $update_webpage_cmd, | 176 command => $update_webpage_cmd, |
| 184 user => www, | 177 user => www, |
| 185 minute => '5-59/20', | 178 minute => '5-59/20', |
| 186 } | 179 } |
| 187 | 180 |
| 188 } | 181 } |
| OLD | NEW |