view modules/apache/templates/vhost/_scriptalias.erb @ 0:956e484adc12

Initial public release of Puppet configs
author IBBoard <dev@ibboard.co.uk>
date Sat, 16 Aug 2014 19:47:38 +0000
parents
children b8d6ada284dd
line wrap: on
line source

<%- if @scriptaliases.is_a?(Array) -%>
<%-  aliases = @scriptaliases -%>
<%- elsif @scriptaliases.is_a?(Hash) -%>
<%-  aliases = [@scriptaliases] -%>
<%- else -%>
<%-  # Nothing to do with any other data type -%>
<%-  aliases = [] -%>
<%- end -%>
<%- if @scriptalias or !aliases.empty? -%>
  ## Script alias directives
<%# Combine scriptalais and scriptaliases into a single data structure -%>
<%# for backward compatibility and ease of implementation -%>
<%- aliases << { 'alias' => '/cgi-bin', 'path' => @scriptalias } if @scriptalias -%>
<%- aliases.flatten.compact! -%>
<%- aliases.each do |salias| -%>
  <%- if salias["path"] != '' -%>
    <%- if salias["alias"] and salias["alias"] != '' -%>
  ScriptAlias <%= salias['alias'] %> "<%= salias['path'] %>"
    <%- elsif salias["aliasmatch"] and salias["aliasmatch"] != '' -%>
  ScriptAliasMatch <%= salias['aliasmatch'] %> "<%= salias['path'] %>"
    <%- end -%>
  <%- end -%>
<%- end -%>
<%- end -%>