Skip to content

Commit

Permalink
Merge pull request #254 from cdenneen/master
Browse files Browse the repository at this point in the history
Added vhost ssl prepend and append
  • Loading branch information
James Fryman committed Feb 10, 2014
2 parents a2abc95 + 7a83b0e commit d2f7f14
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
12 changes: 12 additions & 0 deletions manifests/resource/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@
# put after everything else inside vhost
# [*vhost_cfg_prepend*] - It expects a hash with custom directives to
# put before everything else inside vhost
# [*vhost_cfg_ssl_append*] - It expects a hash with custom directives to
# put after everything else inside vhost ssl
# [*vhost_cfg_ssl_prepend*] - It expects a hash with custom directives to
# put before everything else inside vhost ssl
# [*rewrite_to_https*] - Adds a server directive and rewrite rule to
# rewrite to ssl
# [*include_files*] - Adds include files to vhost
Expand Down Expand Up @@ -169,6 +173,8 @@
$client_max_body_size = undef,
$vhost_cfg_prepend = undef,
$vhost_cfg_append = undef,
$vhost_cfg_ssl_prepend = undef,
$vhost_cfg_ssl_append = undef,
$include_files = undef,
$access_log = undef,
$error_log = undef,
Expand Down Expand Up @@ -288,6 +294,12 @@
if ($vhost_cfg_append != undef) {
validate_hash($vhost_cfg_append)
}
if ($vhost_cfg_ssl_prepend != undef) {
validate_hash($vhost_cfg_ssl_prepend)
}
if ($vhost_cfg_ssl_append != undef) {
validate_hash($vhost_cfg_ssl_append)
}
if ($include_files != undef) {
validate_array($include_files)
}
Expand Down
4 changes: 4 additions & 0 deletions templates/vhost/vhost_ssl_footer.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ include <%= file %>;
<%= key %> <%= value %>;
<% end -%>
<% end -%>
<% if @vhost_cfg_ssl_append -%><% @vhost_cfg_ssl_append.sort_by{ |k, v| k.to_s == 'allow' ? '' : k.to_s }.each do |key,value| -%>
<%= key %> <%= value %>;
<% end -%>
<% end -%>
}
<% if @rewrite_www_to_non_www -%>
server {
Expand Down
8 changes: 7 additions & 1 deletion templates/vhost/vhost_ssl_header.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ server {

access_log <%= @ssl_access_log %>;
error_log <%= @ssl_error_log %>;


<% if @vhost_cfg_prepend -%><% @vhost_cfg_prepend.sort_by{ |k, v| k.to_s == 'allow' ? '' : k.to_s }.each do |key,value| -%>
<%= key %> <%= value %>;
<% end -%><% end -%>
<% if @vhost_cfg_ssl_prepend -%><% @vhost_cfg_ssl_prepend.sort_by{ |k, v| k.to_s == 'allow' ? '' : k.to_s }.each do |key,value| -%>
<%= key %> <%= value %>;
<% end -%><% end -%>
<% if @root -%>
root <%= @root %>;
<% end -%>
Expand Down

0 comments on commit d2f7f14

Please sign in to comment.