# ************************************
# Vhost template in module puppetlabs-apache
# Managed by Puppet
# ************************************
<%= [@comment].flatten.collect{|c| "# #{c}"}.join("\n") -%>

<VirtualHost <%= [@nvh_addr_port].flatten.compact.join(' ') %>>
<% @define.each do | k, v| -%>
  Define <%= k %> <%= v %>
<% end -%>
<% if @servername and not @servername.empty? -%>
  ServerName <%= @servername %>
<% end -%>
<% if @serveradmin -%>
  ServerAdmin <%= @serveradmin %>
<% end -%>
<%# Actually >= 2.4.17, but the minor version is not provided -%>
<% if scope.function_versioncmp([@apache_version, '2.4']) >= 0 -%>
  <%- unless @protocols.empty? -%>
  Protocols <%= @protocols.join(' ') %>
  <%- end -%>
  <%- unless @protocols_honor_order.nil? -%>
  ProtocolsHonorOrder <%= scope.call_function('apache::bool2httpd', [@protocols_honor_order]) %>
  <%- end -%>
<% end -%>
<% if @limitreqfieldsize -%>
  LimitRequestFieldSize <%= @limitreqfieldsize %>
<% end -%>
<% if @limitreqfields -%>
  LimitRequestFields <%= @limitreqfields %>
<% end -%>
<% if @limitreqline -%>
  LimitRequestLine <%= @limitreqline %>
<% end -%>
<% if @limitreqbody -%>
  LimitRequestBody <%= @limitreqbody %>
<% end -%>