diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2011-12-05 18:21:44 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2011-12-05 18:21:44 -0200 |
commit | f78584ac4599e7a019e53f35ce3592006a6a612c (patch) | |
tree | ad8fd01c68ef0df1ae50e2bf1dcbcb10254a5687 | |
parent | 53db8dbfe147b8fccd1907457d5668af6971a0d5 (diff) | |
download | puppet-apache-f78584ac4599e7a019e53f35ce3592006a6a612c.tar.gz puppet-apache-f78584ac4599e7a019e53f35ce3592006a6a612c.tar.bz2 |
Adding https_redirect parameter
-rw-r--r-- | manifests/init.pp | 7 | ||||
-rw-r--r-- | templates/site.erb | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 205b11f..ee8dc3a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -91,6 +91,11 @@ class apache { require => Package["apache"], } + module { "rewrite": + ensure => present, + require => Package["apache"], + } + # apache mod_macro configuration file { "${apache2_macros}": ensure => present, @@ -147,7 +152,7 @@ class apache { $mpm = true, $mpm_user = '', $mpm_group = '', $password = '*', $comment = '', $sshkey = absent, $groups = '', $shell = '/bin/false', $manage_user = true, - $ssl = false, $listen = '*') { + $ssl = false, $listen = '*', $https_redirect = false) { $vhost = $filename ? { '' => "$title", diff --git a/templates/site.erb b/templates/site.erb index be92907..f02dbe0 100644 --- a/templates/site.erb +++ b/templates/site.erb @@ -3,6 +3,9 @@ ServerName <%= title %>.<%= hosting_domain %> <% if server_alias != false %> ServerAlias <%= server_alias %><% end %> DocumentRoot <%= docroot %> + <% if https_redirect != false %> + RewriteEngine On + RewriteRule (.*) https://<%= title %>.<%= hosting_domain %>$1<% end %> <% if redirect_match != false %> RedirectMatch ^/$ <%= protocol %>://<%= title %>.<%= hosting_domain %>/<%= redirect_match %><% end %> <% if redirect != false %> Redirect <%= redirect %><% end %> <% if aliases != false %><% aliases.each do |map| -%> |