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

Unified Diff: modules/adblockplus/manifests/web/redirector.pp

Issue 29481679: #1975 - Introduce class adblockplus::web::redirector (Closed)
Patch Set: Fix examples section in class documentation Created July 6, 2017, 5:12 p.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/web/redirect/eyeo.yaml ('k') | modules/adblockplus/templates/web/redirector.conf.erb » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/adblockplus/manifests/web/redirector.pp
diff --git a/modules/adblockplus/manifests/web/redirector.pp b/modules/adblockplus/manifests/web/redirector.pp
new file mode 100644
index 0000000000000000000000000000000000000000..545afb4aa0e8fefa440648df903bbade674bc50f
--- /dev/null
+++ b/modules/adblockplus/manifests/web/redirector.pp
@@ -0,0 +1,61 @@
+# == Class: adblockplus::web::redirector
+#
+# Manage a simple Nginx-based service for HTTP redirects.
+#
+# See http://hub.eyeo.com/issues/1653 for a use case example,
+# and http://hub.eyeo.com/issues/1975 for more information.
+#
+# === Parameters:
+#
+# [*aliases*]
+# A list of zero or more domain aliases.
+#
+# [*default*]
+# The default URL to redirect to.
+#
+# [*domain*]
+# The domain name the redirector instance is associated with.
+#
+# [*ssl_certificate*]
+# The name of the SSL certificate file within modules/private/files, if any.
+# Requires a private_key as well.
+#
+# [*ssl_private_key*]
+# The name of the private key file within modules/private/files, if any.
+# Requires a certificate as well.
+#
+# [*targets*]
+# A hash of zero or more redirect URL items indexed by the associated URL
+# slug, respectively.
+#
+# === Examples:
+#
+# class {'adblockplus::web::redirector':
+# domain => 'adblockplus.to',
+# targets => {
+# 'jobs' => 'https://eyeo.com/en/jobs',
+# 'team' => 'https://eyeo.com/en/team',
+# },
+# }
+#
+class adblockplus::web::redirector (
+ $aliases = [],
+ $default = 'https://adblockplus.org/',
+ $domain = $::domain,
+ $ssl_certificate = undef,
+ $ssl_private_key = undef,
+ $targets = {},
+) {
+
+ include nginx
+
+ nginx::hostconfig {$title:
+ alt_names => $aliases,
+ content => template('adblockplus/web/redirector.conf.erb'),
+ certificate => $ssl_certificate,
+ domain => $domain,
+ is_default => true,
+ private_key => $ssl_private_key,
+ log => 'access_log_redirects',
+ }
+}
« no previous file with comments | « hiera/roles/web/redirect/eyeo.yaml ('k') | modules/adblockplus/templates/web/redirector.conf.erb » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld