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

userparameter in RedHat Satellite 6.x #125

Closed
CompPhy opened this issue Oct 2, 2015 · 1 comment
Closed

userparameter in RedHat Satellite 6.x #125

CompPhy opened this issue Oct 2, 2015 · 1 comment

Comments

@CompPhy
Copy link

CompPhy commented Oct 2, 2015

I just found an issue with userparameter.pp in the RedHat Satellite 6.1 implementation of Foreman.

I was struggling to get this option to work and ended up having to modify userparameter.pp to actually make it work. Here's why, and my solution...

In the RedHat implementation; you are basically locked out from creating custom "Smart Class Parameters" through the GUI configuration. The stock version of Foreman let's you just add whatever you want through the GUI, but the RedHat version works a little different and has the "add" options locked out.

Armed with a little knowledge on how the GUI class definitions to begin with, which is done by actually parsing the pp files and looking for valid class names, I was able to get it working.

Here's my code modification, the important change here is that I'm actually exposing "data" as a parameter in the class definition. This way Foreman sees the parameter and automatically adds a Smart Class Variable for it. The part about renaming $_data was only necessary because of Puppet throwing "Cannot reassign variable" errors.

I see some other people are having issues with getting UserParameter to work properly; so maybe this will help.

class zabbix::userparameter (
$data = {},
) {
$_data = hiera_hash('zabbix::userparameter::data', $data)
validate_hash($_data)
create_resources('zabbix::userparameters', $_data)
}

@dj-wasabi
Copy link
Contributor

Hi @tcatut

Thank you for making time to create this issue. Explanation is very clear.
To be honest, I'm out of the puppet environment for almost an year and the original 'userparamet.pp' file was written from my head and didn't had (and still) have an puppet environment which has an hiera or foreman setup. (So I never knew if it works..)

I'll update the 'userparameter.pp' file somewhere in the next weeks when I have some time for this. Although you didn't create an PR, I'll add your name to the "Contributors" list (Unless you have an problem with this ;-))

Thanks again!

Kind regards,
Werner

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