From 5b8f70ad6771fb4382912cab9d17f8b264c0f424 Mon Sep 17 00:00:00 2001 From: Baptiste Grenier Date: Thu, 25 Jun 2015 16:17:35 +0200 Subject: [PATCH] redmine::apache: Fix duplicated NameVirtualHost directives. --- manifests/apache.pp | 10 ++++++++++ templates/passenger.erb | 2 -- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/manifests/apache.pp b/manifests/apache.pp index a9df85b..3dc1a6a 100644 --- a/manifests/apache.pp +++ b/manifests/apache.pp @@ -51,6 +51,16 @@ ensure => 'present', } } + # XXX on debian Listen 443 is set in ports.conf, but NameVirtualHost is not + if ! defined(File_line['namevirtualhost-443']) { + file_line { 'namevirtualhost-443': + ensure => 'present', + path => '/etc/apache2/ports.conf', + line => 'NameVirtualHost *:443', + match => '^\s*NameVirtualHost\s*\*:443', + notify => Service['apache'] + } + } file { $::redmine::ssl_cert: ensure => 'present', owner => 'www-data', diff --git a/templates/passenger.erb b/templates/passenger.erb index f6f9134..81ac9ae 100644 --- a/templates/passenger.erb +++ b/templates/passenger.erb @@ -1,7 +1,5 @@ # File Managed by Puppet -NameVirtualHost <%= @ip_addr %>:80 <% if scope.lookupvar('redmine::ssl') %> -NameVirtualHost <%= @ip_addr %>:443 :80> ServerName <%= @server_name %> <%- if @serveraliases != "" -%>