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,54 @@ |
+# == 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. |
+# |
+# TODO Members are handled manually on the target server for now. |
+# Figure out how to provision them. |
+# |
+define adblockplus::web::fileserver::repository ( |
+ $ensure = 'present', |
+){ |
+ |
+ $repositories_directory = "$adblockplus::directory/fileserver/repositories" |
+ $repository_directory = "$repositories_directory/$name" |
+ $repository_host = "$name.$adblockplus::web::fileserver::domain" |
+ |
+ 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!
|
+ group {"www-$name": |
+ ensure => present, |
+ } |
+ |
+ file {"$repository_directory": |
+ ensure => directory, |
+ group => "www-$name", |
+ mode => '0775', |
+ require => [ |
+ File["$repositories_directory"], |
+ Group["www-$name"], |
+ ], |
+ } |
+ |
+ realize(File[$adblockplus::directory]) |
+ |
+ # TODO Figure out how to use $adblockplus::web::directory insetad of hardcoded 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.
|
+ #file {"$adblockplus::web::directory/$name": |
+ file {"/var/www/$repository_host": |
+ ensure => link, |
+ target => "$repository_directory", |
+ require => File["$repository_directory"], |
+ } |
+ } |
+} |
+ |