Colleen Murphy e40a90fa3e Use httpd::vhost $content parameter
Use the new $content parameter of httpd::vhost instead of $template.
This way, the template gets rendered within the scope where it assumes
most of its variables are, and doesn't need to use the scope object
which doesn't work within a defined type. This will ensure the template
keeps working on puppet 4. This also requires adjusting some of the
template parameters that had previously been correctly scoped from the
httpd::vhost defined type.

Depends-On: https://review.openstack.org/570824

Change-Id: I3a45e99e3355d1e59d57d3d989cc03d253529bf2
2018-05-29 11:22:24 +02:00

35 lines
958 B
Plaintext

# ************************************
# Managed by Puppet
# ************************************
NameVirtualHost <%= @_vhost_name %>:<%= @port %>
<VirtualHost <%= @_vhost_name %>:<%= @port %>>
ServerName <%= @srvname %>
<% if @serveraliases.is_a? Array -%>
<% @serveraliases.each do |name| -%><%= " ServerAlias #{name}\n" %><% end -%>
<% elsif ! ['', nil].include?(@serveraliases) -%>
<%= " ServerAlias #{@serveraliases}" %>
<% end -%>
DocumentRoot <%= @docroot %>
<FilesMatch \.log$>
ForceType text/plain
AddDefaultCharset UTF-8
</FilesMatch>
<Directory <%= @docroot %>>
Options <%= @options %>
AllowOverride None
Order allow,deny
allow from all
<IfVersion >= 2.4>
Require all granted
</IfVersion>
</Directory>
<%= @vhost_extra %>
ErrorLog /var/log/apache2/<%= @srvname %>_error.log
LogLevel warn
CustomLog /var/log/apache2/<%= @srvname %>_access.log combined
ServerSignature Off
</VirtualHost>