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

Unified 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: more flexible resource definitions Created Sept. 25, 2017, 9:18 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « modules/adblockplus/manifests/web/fileserver.pp ('k') | modules/private-stub/hiera/hosts.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/adblockplus/manifests/web/fileserver/repository.pp
===================================================================
new file mode 100644
--- /dev/null
+++ b/modules/adblockplus/manifests/web/fileserver/repository.pp
@@ -0,0 +1,50 @@
+# == Type: adblockplus::web::fileserver::repository
+#
+# Manage a repository on a fileserver.
+#
+# A repository is a site where a group of people can upload and artifacts.
+#
+# In its current form, a repository is simply a directory exposed on a web
+# server. This may evolve to make use of more advanced repositories in the
+# future (proxy to repository manager, or 3rd-party service, etc).
+#
+# === parameters:
+#
+# [*ensure*]
+# Whether to set up the repository or not. Removing repositories is not
+# supported.
+#
+# Members are handled manually on the target server for now.
+# Figure out how to provision them some day.
+#
+define adblockplus::web::fileserver::repository (
+ $ensure = 'present',
+){
+
+ $repositories_directory = "$adblockplus::directory/fileserver"
+ $repository_directory = "$repositories_directory/$name"
+ $repository_host = "$name.$adblockplus::web::fileserver::domain"
+
+ group {"www-$name":
+ ensure => $ensure,
+ }
+
+ file {"$repository_directory":
+ ensure => ensure_directory_state($ensure),
+ group => "www-$name",
+ mode => '0775',
+ require => [
+ File["$repositories_directory"],
+ Group["www-$name"],
+ ],
+ }
+
+ realize(File[$adblockplus::directory])
+
+ file {"/var/www/$repository_host":
+ ensure => ensure_symlink_state($ensure),
+ target => "$repository_directory",
+ require => File["$repository_directory"],
+ }
+}
+
« no previous file with comments | « modules/adblockplus/manifests/web/fileserver.pp ('k') | modules/private-stub/hiera/hosts.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld