Skip to content

Commit

Permalink
Merge pull request #390 from cdenneen/patch-1
Browse files Browse the repository at this point in the history
Add include files to locations. Closes #390
  • Loading branch information
Matthew Haughton committed Sep 23, 2014
2 parents 58d5c11 + 324179e commit 8cd1633
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions manifests/resource/location.pp
Expand Up @@ -159,6 +159,7 @@
$location_cfg_append = undef,
$location_custom_cfg_prepend = undef,
$location_custom_cfg_append = undef,
$include = undef,
$try_files = undef,
$proxy_cache = false,
$proxy_cache_valid = false,
Expand Down Expand Up @@ -258,6 +259,9 @@
if ($location_cfg_append != undef) {
validate_hash($location_cfg_append)
}
if ($include != undef) {
validate_array($include)
}
if ($try_files != undef) {
validate_array($try_files)
}
Expand Down
9 changes: 9 additions & 0 deletions spec/defines/resource_location_spec.rb
Expand Up @@ -179,6 +179,15 @@
' test3 subtest2 "sub test value2";',
],
},
{
:title => 'should contain include directives',
:attr => 'include',
:value => [ '/file1', '/file2' ],
:match => [
%r'^\s+include\s+/file1;',
%r'^\s+include\s+/file2;',
],
},
{
:title => 'should contain custom appended directives',
:attr => 'location_custom_cfg_append',
Expand Down
5 changes: 5 additions & 0 deletions templates/vhost/location_footer.erb
Expand Up @@ -32,6 +32,11 @@
<%- Array(@raw_append).each do |line| -%>
<%= line %>
<%- end -%>
<% end -%>
<% if @include -%>
<% @include.each do |include_file| -%>
include <%= include_file %>;
<%- end -%>
<% end -%>
}

0 comments on commit 8cd1633

Please sign in to comment.