Hiera No implicit conversion of string into hash

709 views
Skip to first unread message

Dan Gibbons

unread,
Oct 6, 2014, 9:50:44 AM10/6/14
to puppet...@googlegroups.com
Hi,

I've got a fresh new puppet installation running but I can't seem to get hiera working with the following setup:

OS: RHEL 6.5
Puppet Master: 3.7.1
Ruby: 2.0.0-p576
Hiera: 1.3.4


HIERA.YAML

Hiera.yaml
---
:hierarchy:
- "%{environment}"
- "common"
:backends:
- yaml
:yaml:
  :datadir: /etc/puppet/hieradan


/ETC/PUPPET/HIERADAN/LOCAL.YAML

---
linux-tempdirectory: '/tmp/'
windows-tempdirectory: 'C:\Temp'

Running the following command fails:
# hiera 'windows-tempdirectory' --config /etc/puppet/hiera.yaml --debug
/usr/local/rvm/gems/ruby-2.0.0-p576/gems/hiera-1.3.4/lib/hiera/config.rb:29:in `merge!': no implicit conversion of String into Hash (TypeError)
        from /usr/local/rvm/gems/ruby-2.0.0-p576/gems/hiera-1.3.4/lib/hiera/config.rb:29:in `load'
        from /usr/local/rvm/gems/ruby-2.0.0-p576/gems/hiera-1.3.4/lib/hiera.rb:45:in `initialize'
        from /usr/local/rvm/gems/ruby-2.0.0-p576/gems/hiera-1.3.4/bin/hiera:211:in `new'
        from /usr/local/rvm/gems/ruby-2.0.0-p576/gems/hiera-1.3.4/bin/hiera:211:in `<top (required)>'
        from /usr/local/rvm/gems/ruby-2.0.0-p576/bin/hiera:23:in `load'
        from /usr/local/rvm/gems/ruby-2.0.0-p576/bin/hiera:23:in `<main>'
        from /usr/local/rvm/gems/ruby-2.0.0-p576/bin/ruby_executable_hooks:15:in `eval'
        from /usr/local/rvm/gems/ruby-2.0.0-p576/bin/ruby_executable_hooks:15:in `<main>'

I have "local" set in my agent environment setting.

Any ideas what this could be as I'm really stuck with this at the moment?

Thanks

Dan


Felix Frank

unread,
Oct 28, 2014, 9:18:15 AM10/28/14
to puppet...@googlegroups.com
On 10/06/2014 03:50 PM, Dan Gibbons wrote:
> HIERA.YAML
>
> Hiera.yaml
> ---
> :hierarchy:
> - "%{environment}"
> - "common"
> :backends:
> - yaml
> :yaml:
> :datadir: /etc/puppet/hieradan

Is the second "Hiera.yaml" part of your YAML?

> # hiera 'windows-tempdirectory' --config /etc/puppet/hiera.yaml --debug
> /usr/local/rvm/gems/ruby-2.0.0-p576/gems/hiera-1.3.4/lib/hiera/config.rb:29:in
> `merge!': no implicit conversion of String into Hash (TypeError)

...because that would explain why Hiera is complaining about the String
value where a Hash is expected.
Reply all
Reply to author
Forward
0 new messages