puppet-hiera icon indicating copy to clipboard operation
puppet-hiera copied to clipboard

Array inside Hash not being interpolated

Open maxadamo opened this issue 7 years ago • 0 comments

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.10.9
  • Ruby: ruby embedded with Puppet -> 2.1.0 (?)
  • Distribution: CentOS 7
  • Module version: puppet-hiera

How to reproduce (e.g Puppet code you use)

I need to use an array inside a hash, for the key paths:

{
  'name'           => 'Consul',
  'hiera3_backend' => 'consul',
  'options'        => {
    'host'  => $consul_server,
    'port'  => '8500',
    'paths' => ['/v1/kv/puppet/%{fqdn}']
  },
},

What are you seeing

+  - name: "Consul"
+    hiera3_backend: consul
+    options:
+      host: consul.service.ha.example.net
+      port: 8500
+      paths: [/v1/kv/puppet/%{fqdn}]

What behaviour did you expect instead

+  - name: "Consul"
+    hiera3_backend: consul
+    options:
+      host: consul.service.ha.example.net
+      port: 8500
+      paths: 
+        - /v1/kv/puppet/%{fqdn}

Output log

Any additional information you'd like to impart

There is actually a workaround:

{
  'name'           => 'Consul',
  'hiera3_backend' => 'consul',
  'options'        => {
    'host'  => $consul_server,
    'port'  => '8500',
    'paths' => "\n        - /v1/kv/puppet/%{fqdn}"
  },
},

maxadamo avatar Feb 11 '18 22:02 maxadamo