Hiera concatenated lookup from yaml

Posted by Brian on Server Fault See other posts from Server Fault or by Brian
Published on 2014-05-29T17:52:48Z Indexed on 2014/05/29 21:34 UTC
Read the original article Hit count: 263

Filed under:
|

I am trying to configure the puppet-logstash module via Hiera. When I make the call to hiera('profiles::logstash::config'), the return value is a concatenated string. It tells me that it cannot convert a String into a hash.

shipper.pp

class profiles::logstash::shipper() {

  $shipper_config = hiera('profiles::logstash::config')

  notice("${shipper_config}")
  class { 'logstash':
    ensure  => 'present',
    version => '1.4.1-1_bd507eb',
    status  => 'enabled',
  }

  profiles::logstash::config { $shipper_config: }

  include logstash
}

hostname.yaml

classes:
  - os::repo
  - profiles::logstash::shipper

profiles::logstash::config:
  - {content: this is a test, order: 10}

Output when used with notice():

order10contentthis is a test

Did I order my YAML wrong?

© Server Fault or respective owner

Related posts about puppet

Related posts about hiera