-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
Module Parameters Being Converted When Retreived from Hiera Data #280
Comments
I was able to correct this with a little help from Puppet Support using the literal function in hiera. "hosts/%{literal('%')}{facts.fqdn}.yaml" works perfectly. |
@jcitarello Thanks for posting the fix! Could you please update the README to show this in an example and call out how to access the |
@ghoneycutt Could do, but as of now I am considering if hiera may not be the best place to store and retrieve data by way of include statements and auto-lookup when creating/updating a hiera.yaml file. I mean, it is perfectly acceptable if you already have an existing hiera,yaml and data structure in place to put the parameters, but now I am considering what happens when a path to the data doesn't already exist in hiera, or worse... that path gets removed. If nothing else, it may be prudent to note this chicken/egg situation in any updates to the readme, and I will give it a bit more thought in doing so. |
I simple PR just noting the above would certainly be useful and then we could close this out. |
Affected Puppet, Ruby, OS and module versions/distributions
How to reproduce (e.g Puppet code you use)
Instead of hard coding params via a resource-like declaration, I am attempting to utilize our existing hiera structure with include-like statements.
What are you seeing
The hierarchy entries that utilize fact values are not being literallly translated to the hiera.yaml file that is created.
Ie. This is is the entry in my hiera structure....
#profile::cia::puppet_masters
hiera::hiera_version: '5'
hiera::hiera_yaml: "/usr/local/src/hiera.yaml"
hiera::hiera5_defaults:
datadir: "data"
data_hash: "yaml_data"
hiera::hierarchy:
path: "hosts/%{facts.fqdn}.yaml"
Produces the following result in the hiera.yaml that is created.
path: "hosts/dvtlccm0011.ercot.com.yaml"
What behaviour did you expect instead
I would expect the result to be:
path: "hosts/%{facts.fqdn}.yaml"
Output log
Any additional information you'd like to impart
The text was updated successfully, but these errors were encountered: