From 6d9d88b99a52fb52f4c930bce03a74abf8e80a90 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 8 Nov 2009 18:28:03 -0200 Subject: Adding redirect_match --- manifests/init.pp | 4 ++-- templates/site.erb | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 991a95e..c5b10f5 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -83,8 +83,8 @@ class apache { } define site($ensure = present, $docroot = false, $redirect = false, - $protocol = 'http', $server_alias = false, $use = false, - $ticket = false) { + $redirect_match = false, $protocol = 'http', + $server_alias = false, $use = false, $ticket = false) { file { "${apache2_sites}-available/$title": ensure => $ensure, content => template('apache/site.erb'), diff --git a/templates/site.erb b/templates/site.erb index 1d24628..1d050d6 100644 --- a/templates/site.erb +++ b/templates/site.erb @@ -3,7 +3,8 @@ ServerName <%= title %>.<%= domain %> <% if server_alias != false %> ServerAlias <%= server_alias %><% end %> DocumentRoot <%= docroot %> -<% if redirect != false %> RedirectMatch ^/$ <%= protocol %>://<%= title %>.<%= domain %>/<%= redirect %><% end %> +<% if redirect_match != false %> RedirectMatch ^/$ <%= protocol %>://<%= title %>.<%= domain %>/<%= redirect_match %><% end %> +<% if redirect != false %> Redirect <%= redirect %><% end %> <% if use != false %><% use.each do |instance| -%> Use <%= instance %> <% end -%><% end -%> -- cgit v1.2.3