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

ENC should use valid Puppet variable names #129

Closed
ezr-ondrej opened this issue Apr 1, 2021 · 1 comment
Closed

ENC should use valid Puppet variable names #129

ezr-ondrej opened this issue Apr 1, 2021 · 1 comment

Comments

@ezr-ondrej
Copy link
Member

Currently the Puppet ENC output from Foreman simply takes host parameters as defined, and pushes them into the parameters hash without modification.

The Puppet documentation states: "If present, the value of the parameters key must be a hash of valid variable names and associated values".
https://puppet.com/docs/puppet/7.5/nodes_external.html#enc_output_format-section_rbt_2vm_thb

It is currently possible to use dashes in host parameter names, which are then populated into the ENC output; however, variables may not contain dashes in Puppet.
As a result, host parameters containing dashes are not accessible within Puppet.
(Note: they were previously accessible using the getvar function in Puppet 5, but this no longer works in Puppet 6+).

While it is possible to work around this issue manually by simply not using dashes in host parameters, there are some dashed host parameters that are used in provisioning templates (such as http-proxy), which are useful in Puppet as well. A current workaround is to define the value twice, once for the templates and one for the ENC value for Puppet, but this is inconvenient and prone to accidental drift.

The Foreman ENC output should convert dashes to underscores for host parameter names containing dashes.

@ezr-ondrej
Copy link
Member Author

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

2 participants