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

Interpolate facts with a facts. or trusted. scope #17 #53

Merged
merged 2 commits into from
Jun 3, 2022
Merged

Conversation

oneiros
Copy link
Collaborator

@oneiros oneiros commented May 2, 2022

Variables of the form ${::var} and ${facts.var} should now result in the same interpolation.

@oneiros oneiros changed the title Interpolate facts with a facts. scope #17 Interpolate facts with a facts. or trusted. scope #17 Jun 2, 2022
@oneiros
Copy link
Collaborator Author

oneiros commented Jun 2, 2022

I updated the code according to what we spoke about and noted over in #17:

With this change, hdm only interpolates variables with a facts. or trusted. scope. In both cases leading colons (::) are optional, so both %{::facts.hostname} and %{facts.hostname} will give the same result.

Variables with a facts. scope are expected to be top-scope variables in the facts hash returned by PuppetDB, while variables with a trusted. scope are expected to be nested under the "trusted" key in the facts hash.

@oneiros
Copy link
Collaborator Author

oneiros commented Jun 3, 2022

@rwaffen rwaffen merged commit 1c89d3e into main Jun 3, 2022
@rwaffen rwaffen deleted the issue-17 branch June 3, 2022 12:15
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

Successfully merging this pull request may close these issues.

2 participants