OLD | NEW |
1 # == Class: adblockplus::web::fileserver | 1 # == Class: adblockplus::web::fileserver |
2 # | 2 # |
3 # A fileserver serves multiple file repositories. | 3 # A fileserver serves multiple file repositories. |
4 # | 4 # |
5 # === Parameters: | 5 # === Parameters: |
6 # | 6 # |
7 # [*domain*] | 7 # [*domain*] |
8 # A string which is the name of the fileserver domain, under which | 8 # A string which is the name of the fileserver domain, under which |
9 # each repository has a subdomain. | 9 # each repository has a subdomain. |
10 # | 10 # |
11 # [*certificate*] | 11 # [*certificate*] |
12 # The name of the SSL certificate file within modules/private/files, if any. | 12 # The name of the SSL certificate file within modules/private/files, if any. |
13 # Requires a private_key as well. | 13 # Requires a private_key as well. |
14 # | 14 # |
15 # [*private_key*] | 15 # [*private_key*] |
16 # The name of the private key file within modules/private/files, if any. | 16 # The name of the private key file within modules/private/files, if any. |
17 # Requires a certificate as well. | 17 # Requires a certificate as well. |
18 # | 18 # |
19 # [*is_default*] | |
20 # Passed on to nginx (whether or not the site config should be default). | |
21 # | |
22 # [*repositories*] | 19 # [*repositories*] |
23 # A collection (hash) of repositories to serve. | 20 # A collection (hash) of repositories to serve. |
24 # The contents of a repository is served on a subdomain of the fileserver. | 21 # The contents of a repository is served on a subdomain of the fileserver. |
25 # | 22 # |
26 class adblockplus::web::fileserver( | 23 class adblockplus::web::fileserver( |
27 $ensure = 'present', | 24 $ensure = 'present', |
28 $domain, | 25 $domain, |
29 $certificate = undef, | 26 $certificate = undef, |
30 $private_key = undef, | 27 $private_key = undef, |
31 $repositories={}, | 28 $repositories={}, |
32 ){ | 29 ){ |
33 | 30 |
34 include nginx | 31 include nginx |
35 include adblockplus | 32 include adblockplus |
36 include adblockplus::web | 33 include adblockplus::web |
37 | 34 |
38 realize(File[$adblockplus::directory]) | 35 realize(File[$adblockplus::directory]) |
39 | 36 |
40 file {"$adblockplus::directory/fileserver": | 37 file {"$adblockplus::directory/fileserver": |
41 ensure => directory, | 38 ensure => directory, |
42 } | 39 } |
43 | 40 |
| 41 file {"${::adblockplus::directory}/htpasswd": |
| 42 ensure => directory, |
| 43 } |
| 44 |
44 ensure_resources('adblockplus::web::fileserver::repository', $repositories, { | 45 ensure_resources('adblockplus::web::fileserver::repository', $repositories, { |
45 ensure => 'present', | 46 ensure => 'present', |
46 }) | 47 }) |
47 | |
48 nginx::hostconfig{ "$domain": | |
49 source => 'puppet:///modules/adblockplus/nginx/fileserver.conf', | |
50 is_default => true, | |
51 certificate => $certificate, | |
52 private_key => $private_key, | |
53 log => 'access_log_fileserver', | |
54 } | |
55 } | 48 } |
56 | 49 |
OLD | NEW |