Skip to content

Commit 7d17260

Browse files
authored
Merge pull request #1613 from voxpupuli/fix-broken-map-with-include_files
Fix usage of `include_files` in `nginx::resource::map`
2 parents 12d6b62 + 04dd721 commit 7d17260

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

spec/defines/resource_map_spec.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@
1515
let :default_params do
1616
{
1717
string: '$uri',
18-
default: 'pool_a',
19-
mappings: {
20-
'foo' => 'pool_b',
21-
'bar' => 'pool_c',
22-
'baz' => 'pool_d'
23-
}
2418
}
2519
end
2620

templates/conf.d/map.epp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ map <%= $string %> $<%= $name %> {
1717
<%- $include_files.each |$h| { -%>
1818
include <%= $h %>;
1919
<%- } -%>
20+
<%- unless $mappings.empty { -%>
2021

2122
<%-
2223
$m = $mappings ? {
@@ -28,4 +29,5 @@ $field_width = $m.map |$x| { $x['key'].length }.max
2829
<%- $m.each |$h| { -%>
2930
<%= sprintf("%-*s %s", $field_width, $h['key'], $h['value']) %>;
3031
<%- } -%>
32+
<%- } -%>
3133
}

0 commit comments

Comments
 (0)