Merge branch 'sort_vhost_cfg_append' of https://github.com/jhoblitt/puppet-nginx into dev

This commit is contained in:
root 2013-08-22 22:24:55 +04:00
commit 0a53d710c2

View file

@ -1,7 +1,10 @@
<% if @include_files %><% @include_files.each do |file| -%>
include <%= file %>;
<% end -%><% end -%>
<% if @vhost_cfg_append -%><% vhost_cfg_append.each do |key,value| -%>
<%# make sure that allow comes before deny by forcing the allow key (if it -%>
<%# exists) to be first in the output order. The hash keys also need to be -%>
<%# sorted so that the ordering is stable. -%>
<% if @vhost_cfg_append -%><% vhost_cfg_append.sort_by{ |k, v| k.to_s == 'allow' ? '' : k.to_s }.each do |key,value| -%>
<%= key %> <%= value %>;
<% end -%>
<% end -%>