Missing smart variable

Dear community,

I have a problem to use puppet chocolatey module: https://forge.puppet.com/puppetlabs/chocolatey in foreman. I think i do not have enough know-how in foreman and puppet. I would like to use this module to install software on windows clients, and I see, that it should be easy, I could do something like this:

package { ‘notepadplusplus’:
ensure => installed|latest|‘1.0.0’|absent,
provider => ‘chocolatey’,
install_options => [’-pre’,’-params’,’"’,‘param1’,‘param2’,’"’],
uninstall_options => [’-r’],
source => ‘https://myfeed.example.com/api/v2’,
package_settings => { ‘verbose’ => true, ‘log_output’ => true, },

but i can’t find out how. It would be great if I could define this on the foreman GUI somewhere, but under the chocolatey class i do not see any smart class parameter where i could do this. I have googled much but I’m stuck. I can now understand, that under smart class parameters tab in foreman GUI, only these parameters are visible, which are defined in puppet params.pp. And I see, that in this puppet module there is no possibility to do this installation of any software directly. So I think, that I must create some classes/param’s, somewhere, but I can’t find where and how.

So my question is, could somebody give me a hint, how to do this package installation via the foreman GUI?

Thank you!

I still can’t find any helpful information. :frowning: I’m stuck. I have tried to read the foreman documentation (Foreman :: Manual) but I can’t find any related topic with I could get started.
Anybody, any idea?
Thank you!

The chocolatey module is something you can use, but Foreman can only deal with classes. That means you need to write your own class (or find some existing class) to install your package. Then you can import it and assign it to hosts.

Dear ekohl,

thank you for your suggestion! I have created a class in the original init.pp file under /etc/puppetlabs/code/environments/production/modules/chocolatey/manifests/init.pp. It looks like:

class chocolatey_install_software($install_software){
create_resources(‘package’, $install_software)

and now I have the “install_software” smart variable in foreman. Everything worked fine, until some days ago. I have not made any changes on the systems, but all managed nodes reporting:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Could not find class chocolatey_install_software for client_hostname on node client_hostname

Do you have any suggestion what could be wrong? I searched a lot, but have no idea why it suddenly stopped working. I can’t find nothing on foreman server nor on the agent what could bring me closer to the solution.

Thank you!