Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variables in a single-quote is changed to value - should not be (according to the README) #141

Closed
khdevel opened this issue Jul 21, 2016 · 3 comments

Comments

@khdevel
Copy link

khdevel commented Jul 21, 2016

Affected Puppet, Ruby, OS and module versions/distributions

Puppet v3.8.4

What are you seeing

In the /etc/puppet/hiera.yaml the values in a hierarchy are completed strings but should be with some variables. According to the README it should work in other way.

What behavior did you expect instead

After the puppet executes the code my hiera.yaml file looks as below:

:hierarchy:
  - hieradata/host_type/dev/foreman

But should...:

:hierarchy:
  - "hieradata/host_type/%{::deployment_group}/%{::host_type}"

If I "escape" the special characters I have a mess in my hiera.yaml:
Configuration:

classes:
  - hiera
hiera::hierarchy:
  - 'hieradata/host_type/\%\{\:\:deployment_group\}/\%\{\:\:host_type\}'

Output:

:hierarchy:
  - 'hieradata/host_type/\x5c%\x5c{\x5c:\x5c:deployment_group\x5c}/\x5c%\x5c{\x5c:\x5c:host_type\}'

How did this behavior get triggered

My configuration for THIS host in hieradata is:

classes:
  - hiera
hiera::hierarchy:
  - 'hieradata/host_type/%{::deployment_group}/%{::host_type}'

Output log

Any additional information you'd like to impart

@ortegaga
Copy link

ortegaga commented Sep 2, 2016

Well, in fact README doesn't explain the way to "feed" class parameters via hiera itself. According to this ticket, you must define your hierarchy this way:

hiera::hierarchy:
  - 'hieradata/host_type/%%{}{::deployment_group}/%%{}{::host_type}'

At least, this solved the problem for me.

@khdevel
Copy link
Author

khdevel commented Sep 7, 2016

Thank you very much ortegaga, finally someone read my issue :) I will check it today!

@dhoppe
Copy link
Member

dhoppe commented Dec 29, 2016

@khdevel I assume your tests were successful.

@dhoppe dhoppe closed this as completed Dec 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants