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

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

Issue 29767587: #10349 - Allow files in domain root directory (Closed)
Patch Set: Use better naming convention Created May 3, 2018, 1:59 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
« no previous file with comments | « hiera/roles/web/fileserver/trusted-news.yaml ('k') | modules/private-stub/hiera/hosts.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # == Type: adblockplus::web::fileserver::repository 1 # == Type: adblockplus::web::fileserver::repository
2 # 2 #
3 # Manage a repository on a fileserver. 3 # Manage a repository on a fileserver.
4 # 4 #
5 # A repository is a site where a group of people can upload and artifacts. 5 # A repository is a site where a group of people can upload and artifacts.
6 # 6 #
7 # In its current form, a repository is simply a directory exposed on a web 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 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). 9 # future (proxy to repository manager, or 3rd-party service, etc).
10 # 10 #
11 # === parameters: 11 # === parameters:
12 # 12 #
13 # [*ensure*] 13 # [*ensure*]
14 # Whether to set up the repository or not. Removing repositories is not 14 # Whether to set up the repository or not. Removing repositories is not
15 # supported. 15 # supported.
16 # 16 #
17 # [*users*] 17 # [*users*]
18 # System users that should be created and added to the group that has 18 # System users that should be created and added to the group that has
19 # write permissions for the repository directory 19 # write permissions for the repository directory
20 # 20 #
21 define adblockplus::web::fileserver::repository ( 21 define adblockplus::web::fileserver::repository (
22 $ensure = 'present', 22 $ensure = 'present',
23 $users = {}, 23 $users = {},
24 ){ 24 ){
25 25
26 $repositories_directory = "$adblockplus::directory/fileserver" 26 $repositories_directory = "$adblockplus::directory/fileserver"
27 $repository_directory = "$repositories_directory/$name" 27 $repository_directory = "$repositories_directory/$name"
28 $repository_host = "$name.$adblockplus::web::fileserver::domain" 28 $group_name = "www-$name"
29 $repository_host = $name ? {
30 'www' => "$adblockplus::web::fileserver::domain",
31 default => "$name.$adblockplus::web::fileserver::domain",
32 }
29 33
30 group {"www-$name": 34 group {"$group_name":
31 ensure => $ensure, 35 ensure => $ensure,
32 } 36 }
33 37
34 file {"$repository_directory": 38 file {"$repository_directory":
35 ensure => ensure_directory_state($ensure), 39 ensure => ensure_directory_state($ensure),
36 group => "www-$name", 40 group => $group_name,
37 mode => '0775', 41 mode => '0775',
38 require => [ 42 require => [
39 File["$repositories_directory"], 43 File["$repositories_directory"],
40 Group["www-$name"], 44 Group[$group_name],
41 ], 45 ],
42 } 46 }
43 47
44 ensure_resources('adblockplus::user', $users, { 48 ensure_resources('adblockplus::user', $users, {
45 ensure => $ensure, 49 ensure => $ensure,
46 password_hash => '*', 50 password_hash => '*',
47 groups => ["www-$name"], 51 groups => [$group_name],
48 }) 52 })
49 53
50 realize(File[$adblockplus::directory]) 54 realize(File[$adblockplus::directory])
51 55
52 file {"/var/www/$repository_host": 56 file {"/var/www/$repository_host":
53 ensure => ensure_symlink_state($ensure), 57 ensure => ensure_symlink_state($ensure),
54 target => "$repository_directory", 58 target => "$repository_directory",
55 require => File["$repository_directory"], 59 require => File["$repository_directory"],
56 } 60 }
57 } 61 }
58 62
OLDNEW
« no previous file with comments | « hiera/roles/web/fileserver/trusted-news.yaml ('k') | modules/private-stub/hiera/hosts.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld