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

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

Issue 29551585: #2317 - provide role fileserver for eyeofiles.com (Closed) Base URL: https://hg1/infrastructure
Patch Set: use single nginx conf based on $host Created Sept. 25, 2017, 11:24 a.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 # == Type: adblockplus::web::fileserver::repository
2 #
3 # Manage a repository on a fileserver.
4 #
5 # A repository is a site where a group of people can upload and artifacts.
6 #
7 # In its current form, a repository is simply a directory exposed on a web
8 # server. This may evolve to make use of more advanced repositories in the
9 # future (proxy to repository manager, or 3rd-party service, etc).
10 #
11 # === parameters:
12 #
13 # [*ensure*]
14 # Whether to set up the repository or not. Removing repositories is not
15 # supported.
16 #
17 # TODO Members are handled manually on the target server for now.
18 # Figure out how to provision them.
19 #
20 define adblockplus::web::fileserver::repository (
21 $ensure = 'present',
22 ){
23
24 $repositories_directory = "$adblockplus::directory/fileserver/repositories"
25 $repository_directory = "$repositories_directory/$name"
26 $repository_host = "$name.$adblockplus::web::fileserver::domain"
27
28 if $ensure !~ /^(absent|purged)$/ {
mathias 2017/09/25 17:06:04 Can't you avoid the conditional and base parameter
f.nicolaisen 2017/09/25 20:21:18 I can try!
29 group {"www-$name":
30 ensure => present,
31 }
32
33 file {"$repository_directory":
34 ensure => directory,
35 group => "www-$name",
36 mode => '0775',
37 require => [
38 File["$repositories_directory"],
39 Group["www-$name"],
40 ],
41 }
42
43 realize(File[$adblockplus::directory])
44
45 # TODO Figure out how to use $adblockplus::web::directory insetad of hardcod ed path
mathias 2017/09/25 17:06:04 ?
f.nicolaisen 2017/09/25 20:21:18 I discussed this with Paco, and he said it would n
mathias 2017/09/25 21:08:50 The '/var/www' path is not configurable for that d
f.nicolaisen 2017/09/25 21:19:47 Acknowledged.
46 #file {"$adblockplus::web::directory/$name":
47 file {"/var/www/$repository_host":
48 ensure => link,
49 target => "$repository_directory",
50 require => File["$repository_directory"],
51 }
52 }
53 }
54
OLDNEW

Powered by Google App Engine
This is Rietveld