Ask Your Question

hiera install/config problem

asked 2013-01-23 11:17:07 -0600

lfast gravatar image

updated 2013-01-24 10:22:36 -0600

llowder gravatar image

After following my first attempt to use our existing hiera config generates the following error:

Error: Could not run: (/etc/puppet/hiera.yaml): found character that cannot start any token while scanning for the next token at line 8 column 7

But line 8 col 7 is completely innocuous. Also, this file works fine on all our other puppet masters. File is below, apologies that formatting obscures the text.


    - yaml

:logger: console


    - %{project}/%{server_env}/%{module_name}    ****** This is the offending line ****
    - %{project}/%{server_env}/common
    - %{project}/%{role_name}-role/%{module_name}
    - %{project}/%{module_name}
    - %{location}/%{module_name}
    - %{module_name ...
edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2013-04-08 04:26:59 -0600

calpaterson gravatar image

You need to wrap variable substitutions in DOUBLE quotes, just like with puppet. eg: "%{module_name}" instaed of %{module_name}. It seems that hiera previously did not require this. As of the current version (1.2.0) it does

edit flag offensive delete link more


I have no idea if this answer fixed the original poster's problem, but it certainly fixed mine.

Mike Renfro gravatar imageMike Renfro ( 2013-05-09 09:57:27 -0600 )edit

This actually isn't caused by the Hiera version --- it is caused by Ruby. Ruby 1.9.x moved to a new, stricter, YAML parser called Psych that chokes on ...(more)

csharpsteen gravatar imagecsharpsteen ( 2013-09-25 16:59:10 -0600 )edit

answered 2013-01-23 13:38:22 -0600

ramindk gravatar image

updated 2013-01-23 13:39:02 -0600

Try swapping out %{module_name} for %{calling_module}.

Also you may want to put - %{fqdn} at the top of the hierarchy so you can override for a particular server if you need it. It's helpful in troubleshooting or testing a new config.

edit flag offensive delete link more


Tried the swap, no change. It's hard to see in the listing but the character it's failing on is actually the very first '{' as in - %{project}

lfast gravatar imagelfast ( 2013-01-23 16:20:04 -0600 )edit

Is this error actually trying to tell me that there is no Fact available for ${project} ?

lfast gravatar imagelfast ( 2013-01-23 16:20:38 -0600 )edit

It's possible that Hiera expects the fact to exist even if the dir or files don't. What happens if you do a test without any of your custom ...(more)

ramindk gravatar imageramindk ( 2013-01-23 16:35:16 -0600 )edit

working towards that. I'm still a newbie so that will take some time...

lfast gravatar imagelfast ( 2013-01-23 16:38:01 -0600 )edit

answered 2013-01-23 19:13:42 -0600

lfast gravatar image

updated 2013-01-23 19:15:13 -0600

I'm going to assume, for the moment, that it's a problem with pre-existing facts.

[but I can't mark this as answered because I'm a pointless newbie]

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-01-23 11:17:07 -0600

Seen: 2,700 times

Last updated: Apr 08 '13