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

Side by Side Diff: modules/adblockplus/manifests/web/fileserver.pp

Issue 29551585: #2317 - provide role fileserver for eyeofiles.com (Closed) Base URL: https://hg1/infrastructure
Patch Set: replace hardcoded repository with definition Created Sept. 21, 2017, 9:34 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::fileserver
2 #
3 # Serves files for different repositories over https.
4 #
5 # === Parameters:
6 #
7 # [*domain*]
8 # A string for the domain serving traffic.
mathias 2017/09/22 07:00:14 Why would the domain want to have some string? And
f.nicolaisen 2017/09/22 07:57:44 Acknowledged.
9 #
10 # [*certificate*]
11 # The name of the SSL certificate file within modules/private/files, if any.
12 # Requires a private_key as well.
13 #
14 # [*private_key*]
15 # The name of the private key file within modules/private/files, if any.
16 # Requires a certificate as well.
17 #
18 # [*is_default*]
mathias 2017/09/22 07:00:14 The fileserver is a standalone HTTPd setup intende
f.nicolaisen 2017/09/22 07:57:44 Acknowledged.
19 # Passed on to nginx (whether or not the site config should be default).
20 #
21 # [*repository*]
mathias 2017/09/22 07:00:14 The documentation of the $repository parameter doe
f.nicolaisen 2017/09/22 07:57:43 Acknowledged.
22 # A string that is the name of the repository to serve. A repository
23 # is a collection of files uploaded by a group of users.
24 #
25 # TODO Convert this into a collection of *repositories*
26 #
27 class adblockplus::web::fileserver(
28 $domain,
29 $certificate,
mathias 2017/09/22 07:00:14 Both $certificate and $private_key should default
f.nicolaisen 2017/09/22 07:57:43 Acknowledged.
30 $private_key,
31 $is_default=false,
32 $repositories={},
33 ){
34
35 include nginx
36 include adblockplus
37 include adblockplus::web
38
39 nginx::hostconfig{$domain:
40 source => 'puppet:///modules/adblockplus/nginx/fileserver.conf',
41 is_default => $is_default,
42 certificate => $certificate,
43 private_key => $private_key,
44 log => 'access_log_files'
45 }
46
47 # Root directory for serving repositories
48 realize(File[$adblockplus::directory])
49
50
51 file {[
52 "$adblockplus::directory/fileserver",
53 "$adblockplus::directory/fileserver/repositories"
54 ]:
55 ensure => directory,
56 }
57
58
59 if !empty($repositories) {
mathias 2017/09/22 07:00:14 This conditional is not necessary: Iterating throu
f.nicolaisen 2017/09/22 07:57:44 Acknowledged.
60 ensure_resources('repository', $repositories, {
mathias 2017/09/22 07:00:14 Please use the fully qualified name here, e.g. adb
f.nicolaisen 2017/09/22 07:57:43 Acknowledged.
61 ensure => 'present',
62 })
63 }
64
65 }
66
OLDNEW

Powered by Google App Engine
This is Rietveld