OLD | NEW |
(Empty) | |
| 1 # == Class: adblockplus::web::redirector |
| 2 # |
| 3 # Manage a simple Nginx-based service for HTTP redirects. |
| 4 # |
| 5 # See http://hub.eyeo.com/issues/1653 for a use case example, |
| 6 # and http://hub.eyeo.com/issues/1975 for more information. |
| 7 # |
| 8 # === Parameters: |
| 9 # |
| 10 # [*aliases*] |
| 11 # A list of zero or more domain aliases. |
| 12 # |
| 13 # [*default*] |
| 14 # The default URL to redirect to. |
| 15 # |
| 16 # [*domain*] |
| 17 # The domain name the redirector instance is associated with. |
| 18 # |
| 19 # [*ssl_certificate*] |
| 20 # The name of the SSL certificate file within modules/private/files, if any. |
| 21 # Requires a private_key as well. |
| 22 # |
| 23 # [*ssl_private_key*] |
| 24 # The name of the private key file within modules/private/files, if any. |
| 25 # Requires a certificate as well. |
| 26 # |
| 27 # [*targets*] |
| 28 # A hash of zero or more redirect URL items indexed by the associated URL |
| 29 # slug, respectively. |
| 30 # |
| 31 # === Examples: |
| 32 # |
| 33 # class {'adblockplus::web::redirector': |
| 34 # domain => 'adblockplus.to', |
| 35 # targets => { |
| 36 # 'jobs' => 'https://eyeo.com/en/jobs', |
| 37 # 'team' => 'https://eyeo.com/en/team', |
| 38 # }, |
| 39 # } |
| 40 # |
| 41 class adblockplus::web::redirector ( |
| 42 $aliases = [], |
| 43 $default = 'https://adblockplus.org/', |
| 44 $domain = $::domain, |
| 45 $ssl_certificate = undef, |
| 46 $ssl_private_key = undef, |
| 47 $targets = {}, |
| 48 ) { |
| 49 |
| 50 include nginx |
| 51 |
| 52 nginx::hostconfig {$title: |
| 53 alt_names => $aliases, |
| 54 content => template('adblockplus/web/redirector.conf.erb'), |
| 55 certificate => $ssl_certificate, |
| 56 domain => $domain, |
| 57 is_default => true, |
| 58 private_key => $ssl_private_key, |
| 59 log => 'access_log_redirects', |
| 60 } |
| 61 } |
OLD | NEW |