OLD | NEW |
(Empty) | |
| 1 # == Class: adblockplus::telemetry |
| 2 # |
| 3 # A receiver for incoming statistic data and reports. |
| 4 # |
| 5 # === Parameters: |
| 6 # |
| 7 # [*domain*] |
| 8 # The authorative domain to bind to, although the setup will ensure |
| 9 # the host being the one used by default. |
| 10 # |
| 11 # [*endpoints*] |
| 12 # A hash of adblockplus::telemetry::endpoint setup parameters to become |
| 13 # included with the class. |
| 14 # |
| 15 # [*ssl_cert*] |
| 16 # If provided, the host will bind to HTTPS, and redirect from HTTP. |
| 17 # Requires $ssl_key to be given as well. |
| 18 # |
| 19 # [*ssl_key*] |
| 20 # The private SSL key the $ssl_cert is associated with. |
| 21 # |
| 22 # === Examples: |
| 23 # |
| 24 # class {'adblockplus::telemetry': |
| 25 # domain => 'telemetry.adblockplus.org', |
| 26 # endpoints => { |
| 27 # # see adblockplus::telemetry::endpoint |
| 28 # }, |
| 29 # } |
| 30 # |
| 31 class adblockplus::telemetry ( |
| 32 $domain, |
| 33 $endpoints = hiera('adblockplus::telemetry::endpoints', {}), |
| 34 $ssl_cert = hiera('adblockplus::telemetry::ssl_cert', ''), |
| 35 $ssl_key = hiera('adblockplus::telemetry::ssl_key', ''), |
| 36 ) { |
| 37 |
| 38 include adblockplus |
| 39 include nginx |
| 40 |
| 41 $endpoints_config_name = 'adblockplus::telemetry#endpoints' |
| 42 $endpoints_config_path = '/etc/nginx/adblockplus_telemetry_endpoints.conf' |
| 43 |
| 44 concat {$endpoints_config_name: |
| 45 notify => Service['nginx'], |
| 46 path => $endpoints_config_path, |
| 47 require => Package['nginx'], |
| 48 } |
| 49 |
| 50 create_resources('adblockplus::telemetry::endpoint', $endpoints, { |
| 51 ensure => 'present', |
| 52 }) |
| 53 |
| 54 nginx::hostconfig {$domain: |
| 55 certificate => $ssl_cert ? {'' => undef, default => $ssl_cert}, |
| 56 content => "include $endpoints_config_path;\n", |
| 57 is_default => true, |
| 58 private_key => $ssl_key ? {'' => undef, default => $ssl_key}, |
| 59 log => 'access_log_telemetry', |
| 60 require => Concat[$endpoints_config_name], |
| 61 } |
| 62 } |
OLD | NEW |