Pass parameter to a module

I have ModuleC and there i have something like::

class moduleC (
  Enum['present', 'absent'] 
  $ensure = 'present',
) {
  if $ensure == 'present' {
    # do the stuff to build your module
  } else {
    file {'C:\\A\C':
      ensure => 'absent',

Now NodeX has this ModuleC which is in configGroup->HostGroup and It works.

When I change the HostGroup of the NodeX I want remove also the files which this module created on NodeX.

How can I pass absent to the $ensure variable on the class ?

Or if one have better idea please let me know.

Thanks in advance

Does anyone know about the Host Parameters:

Does foreman send those Host Parameters to the Puppet modules which I created ?

You can see everything which is sent for a host, if you click on the “YAML” button on the host page. It contains all parameters.

1 Like

thank you @gvde its was new for me but very good point thanks