From 85eec8d22b4e774430d3b75df4eae6e92f9c386f Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Wed, 20 Jan 2016 15:30:52 +0200 Subject: [PATCH] abusesa::serivices: Add support for filesystem paths --- abusesa/manifests/services.pp | 1 + abusesa/templates/services/nginx.conf.erb | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/abusesa/manifests/services.pp b/abusesa/manifests/services.pp index dd61790..6ff6dd5 100644 --- a/abusesa/manifests/services.pp +++ b/abusesa/manifests/services.pp @@ -2,6 +2,7 @@ # class abusesa::services( $allow_dn=undef, + $paths=[], $services=[], $socketdir='/var/lib/abuserv/run', ) { diff --git a/abusesa/templates/services/nginx.conf.erb b/abusesa/templates/services/nginx.conf.erb index fbf5e46..ca5b15f 100644 --- a/abusesa/templates/services/nginx.conf.erb +++ b/abusesa/templates/services/nginx.conf.erb @@ -20,6 +20,16 @@ server { return 403; } +<% end -%> +<% @paths.each do |path| + filep, sep, urlp = path.partition(':') + continue if filep.empty? or urlp.empty? +-%> + location <%= urlp %> { + alias <%= filep %>; + autoindex on; + } + <% end -%> <% @services.each do |service| dir, sep, sock = service.rpartition('/')