diff --git a/spec/defines/resource_map_spec.rb b/spec/defines/resource_map_spec.rb index 6cd03b2d2..14bf1e79f 100644 --- a/spec/defines/resource_map_spec.rb +++ b/spec/defines/resource_map_spec.rb @@ -15,12 +15,6 @@ let :default_params do { string: '$uri', - default: 'pool_a', - mappings: { - 'foo' => 'pool_b', - 'bar' => 'pool_c', - 'baz' => 'pool_d' - } } end diff --git a/templates/conf.d/map.epp b/templates/conf.d/map.epp index 612bc5eed..8cbb816c0 100644 --- a/templates/conf.d/map.epp +++ b/templates/conf.d/map.epp @@ -17,6 +17,7 @@ map <%= $string %> $<%= $name %> { <%- $include_files.each |$h| { -%> include <%= $h %>; <%- } -%> +<%- unless $mappings.empty { -%> <%- $m = $mappings ? { @@ -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']) %>; <%- } -%> +<%- } -%> }