You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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 ;-))
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)
}
The text was updated successfully, but these errors were encountered: