Ask Your Question
2

hiera install/config problem

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

lfast gravatar image

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

llowder gravatar image

After following http://puppetlabs.com/blog/first-look-installing-and-using-hiera/ 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.

Suggestions?


---
:backends:
    - yaml

:logger: console

:hierarchy:

    - %{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 ...
(more)
edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
4

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

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

Comments

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 -0500 )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 -0500 )edit
0

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

ramindk gravatar image

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

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

Comments

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 -0500 )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 -0500 )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 -0500 )edit

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

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

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

lfast gravatar image

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

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

Stats

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

Seen: 2,526 times

Last updated: Apr 08 '13