Index: modules/fileserver/manifests/init.pp |
=================================================================== |
new file mode 100644 |
--- /dev/null |
+++ b/modules/fileserver/manifests/init.pp |
@@ -0,0 +1,57 @@ |
+# This class is a quickfix for solving http://hub.eyeo.com/issues/2295 |
+class fileserver( |
mathias
2017/09/21 11:43:20
This should be an entity within namespace adblockp
f.nicolaisen
2017/09/21 14:17:13
Acknowledged.
|
+ $domain, |
+ $certificate, |
+ $private_key, |
+ $is_default=false |
+ ) { |
+ |
+ class {'nginx': |
mathias
2017/09/21 11:43:20
Please use `include` when there are no explicit pa
f.nicolaisen
2017/09/21 14:17:13
Acknowledged.
|
+ } |
+ |
+ File { |
+ owner => 'root', |
+ group => 'root', |
+ mode => '0755', |
+ } |
+ |
+ # Root directory for serving files: |
+ file {'/var/files': |
mathias
2017/09/21 11:43:20
Probably obsolete, see below.
f.nicolaisen
2017/09/21 14:17:13
Acknowledged.
|
+ ensure => directory, |
+ } |
+ |
+ file {'/var/www': |
mathias
2017/09/21 11:43:20
You can drop this one in favor of including the ad
f.nicolaisen
2017/09/21 14:17:13
Acknowledged.
|
+ ensure => directory, |
+ } |
+ |
+ # Directory with new group www-v8 where uploaders can be made members of: |
mathias
2017/09/21 11:43:20
What for? That should be documented.
f.nicolaisen
2017/09/21 14:17:13
Acknowledged.
|
+ # Members are handled manually on-demand for now! |
+ group {'www-v8': |
+ ensure => present, |
+ }-> |
mathias
2017/09/21 11:43:20
Please avoid using this form of relationship notat
f.nicolaisen
2017/09/21 14:17:13
Acknowledged.
|
+ |
+ file {'/var/files/v8': |
mathias
2017/09/21 11:43:20
What for? This should be something with a more mea
f.nicolaisen
2017/09/21 14:17:13
Acknowledged.
|
+ ensure => directory, |
+ group => 'www-v8', |
+ mode => '0775', |
+ } |
+ |
+ #Symlink above directory into www: |
+ file {'/var/www/v8': |
mathias
2017/09/21 11:43:19
What for? That should be documented.
f.nicolaisen
2017/09/21 14:17:13
Acknowledged.
|
+ ensure => link, |
+ target => '/var/files/v8', |
+ require => [ |
+ File['/var/files/v8'], |
+ Package['nginx'], |
+ ], |
+ } |
+ |
+ nginx::hostconfig{$domain: |
+ source => 'puppet:///modules/fileserver/site.conf', |
+ is_default => $is_default, |
+ certificate => $certificate, |
+ private_key => $private_key, |
+ log => 'access_log_update' |
mathias
2017/09/21 11:43:20
Why *_update?
f.nicolaisen
2017/09/21 14:17:13
Acknowledged.
|
+ } |
+} |
+ |