From 29e7c0b2921c2a67a020b411d1df11a60a865afb Mon Sep 17 00:00:00 2001 From: Adrien Thebo Date: Sun, 18 Mar 2012 23:45:31 -0700 Subject: Add SSL tune options for gitweb --- manifests/init.pp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index ae241c6..a24af8c 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,5 +1,5 @@ # Class: gitweb -# Installs gitweb and configures apache to server it. +# Installs gitweb and configures apache to serve it. # Parameters: # # Actions: @@ -36,10 +36,24 @@ class gitweb($site_alias, $doc_root, $project_root, $projects_list, $ssl = true) source => 'puppet:///modules/gitweb/html/index.cgi', } - apache::vhost { "${site_alias}_ssl": + if $ssl == true { + # Listen on port 443 and enable SSL redirection + + apache::vhost::redirect { $site_alias: + port => "80", + dest => "https://${site_alias}", + } + + $apache_port = '443' + } + else { + $apache_port = '80' + } + + apache::vhost { $site_alias: priority => "10", - port => "443", - ssl => true, + port => $apache_port, + ssl => $ssl, docroot => $doc_root, template => "gitweb/apache-gitweb.conf.erb", } -- cgit v1.2.3