Skip to content

Commit

Permalink
Merge pull request #1613 from voxpupuli/fix-broken-map-with-include_f…
Browse files Browse the repository at this point in the history
…iles

Fix usage of `include_files` in `nginx::resource::map`
  • Loading branch information
smortex authored Sep 10, 2024
2 parents 12d6b62 + 04dd721 commit 7d17260
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 0 additions & 6 deletions spec/defines/resource_map_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@
let :default_params do
{
string: '$uri',
default: 'pool_a',
mappings: {
'foo' => 'pool_b',
'bar' => 'pool_c',
'baz' => 'pool_d'
}
}
end

Expand Down
2 changes: 2 additions & 0 deletions templates/conf.d/map.epp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ map <%= $string %> $<%= $name %> {
<%- $include_files.each |$h| { -%>
include <%= $h %>;
<%- } -%>
<%- unless $mappings.empty { -%>

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

0 comments on commit 7d17260

Please sign in to comment.