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

Side by Side 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.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(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 }
OLDNEW
« 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