Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/adblockplus/manifests/telemetry.pp

Issue 29329669: Issue 3261 - Introduce module adblockplus::telemetry (Closed)
Patch Set: Issue 3261 - Rename /submit/{filter-hit-statistics => adblockplus} Created Nov. 13, 2015, 9:29 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « hiera/roles/telemetryserver.yaml ('k') | modules/adblockplus/manifests/telemetry/endpoint.pp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/adblockplus/manifests/telemetry.pp
diff --git a/modules/adblockplus/manifests/telemetry.pp b/modules/adblockplus/manifests/telemetry.pp
new file mode 100644
index 0000000000000000000000000000000000000000..82b6a56f0f1b38597cd78058446688809cdbf327
--- /dev/null
+++ b/modules/adblockplus/manifests/telemetry.pp
@@ -0,0 +1,62 @@
+# == Class: adblockplus::telemetry
+#
+# A receiver for incoming statistic data and reports.
+#
+# === Parameters:
+#
+# [*domain*]
+# The authorative domain to bind to, although the setup will ensure
+# the host being the one used by default.
+#
+# [*endpoints*]
+# A hash of adblockplus::telemetry::endpoint setup parameters to become
+# included with the class.
+#
+# [*ssl_cert*]
+# If provided, the host will bind to HTTPS, and redirect from HTTP.
+# Requires $ssl_key to be given as well.
+#
+# [*ssl_key*]
+# The private SSL key the $ssl_cert is associated with.
+#
+# === Examples:
+#
+# class {'adblockplus::telemetry':
+# domain => 'telemetry.adblockplus.org',
+# endpoints => {
+# # see adblockplus::telemetry::endpoint
+# },
+# }
+#
+class adblockplus::telemetry (
+ $domain,
+ $endpoints = hiera('adblockplus::telemetry::endpoints', {}),
+ $ssl_cert = hiera('adblockplus::telemetry::ssl_cert', ''),
+ $ssl_key = hiera('adblockplus::telemetry::ssl_key', ''),
+) {
+
+ include adblockplus
+ include nginx
+
+ $endpoints_config_name = 'adblockplus::telemetry#endpoints'
+ $endpoints_config_path = '/etc/nginx/adblockplus_telemetry_endpoints.conf'
+
+ concat {$endpoints_config_name:
+ notify => Service['nginx'],
+ path => $endpoints_config_path,
+ require => Package['nginx'],
+ }
+
+ create_resources('adblockplus::telemetry::endpoint', $endpoints, {
+ ensure => 'present',
+ })
+
+ nginx::hostconfig {$domain:
+ certificate => $ssl_cert ? {'' => undef, default => $ssl_cert},
+ content => "include $endpoints_config_path;\n",
+ is_default => true,
+ private_key => $ssl_key ? {'' => undef, default => $ssl_key},
+ log => 'access_log_telemetry',
+ require => Concat[$endpoints_config_name],
+ }
+}
« no previous file with comments | « hiera/roles/telemetryserver.yaml ('k') | modules/adblockplus/manifests/telemetry/endpoint.pp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld