Add ServerAlias support to the vhost config

Change-Id: I04b232120531a91a3a402d7507c04979e24f0856
This commit is contained in:
K Jonathan Harker 2016-07-07 16:36:29 -07:00 committed by K Jonathan Harker
parent 25c40f20a7
commit dcc876c7a9
2 changed files with 6 additions and 0 deletions

View File

@ -6,6 +6,7 @@ class hound (
$datadir = '/home/hound/data',
$manage_config = true,
$serveradmin = "webmaster@${::fqdn}",
$serveraliases = undef,
$vhost_name = $::fqdn,
) {

View File

@ -1,5 +1,10 @@
<VirtualHost *:80>
ServerName <%= scope.lookupvar("hound::vhost_name") %>
<% if @serveraliases.is_a? Array -%>
<% @serveraliases.each do |name| %><%= " ServerAlias #{name}\n" %><% end %>
<% elsif @serveraliases -%>
<%= " ServerAlias #{@serveraliases}" %>
<% end %>
ServerAdmin <%= @serveradmin %>
ErrorLog ${APACHE_LOG_DIR}/<%= scope.lookupvar("hound::vhost_name") %>-error.log