Add a parameter to grubipv6disable class which controls the internal behaviour.
https://puppet.com/docs/puppet/6.17/lang_classes.html#class-parameters-and-variables
 
<https://puppet.com/docs/puppet/6.17/lang_classes.html#class-parameters-and-variables>

e.g.

# modules/grubipv6disable/manifests/init.pp
class grubipv6disable (
  Boolean $enable = true,
){
  if $enable {
    # add here the code from the class.
  }
}

Now you add hiera.yaml to your control-repo and add node specific data.
https://puppet.com/docs/puppet/6.17/hiera_intro.html 
<https://puppet.com/docs/puppet/6.17/hiera_intro.html>

e.g.
data/nodes/<nodename>.yaml
---
grubipv6disable::enable: false

Hth,
Martin


> On 17. Sep 2020, at 19:19, [email protected] <[email protected]> wrote:
> 
> Hello experts,
> 
> I apply all my current classes like so:
> 
> # cat site.pp
> 
> node default {
>   class { 'selinux':
>     mode => 'permissive',
>     type => 'targeted',      }
>   class { 'commonpackages':  }
>   class { 'polkit':          }
>   class { 'libstoragemgmt':  }
>   class { 'rngd':            }
>   class { 'gssproxy':        }
>   class { 'smartd':          }
>   class { 'firewalld':       }
>   class { 'grubipv6disable': }
>   class { 'grubrootpasswd':  }
>   class { 'grubcrash':       }
>   class { 'logrotate':       }
>   class { 'htop':            }
>   class { 'vim':             }
>   class { 'yum':             }
>   class { 'yumlocalrepo':    }
>   class { 'sysctl':          }
>   class { 'sysconfig':       }
>   class { 'bashrc':          }
>   class { 'vault':           }
>   class { 'useradd':         }
>   class { 'crontab':         }
>   class { 'modprobe':        }
>   class { 'rsyslogd':        }
>   class { 'sudoers':         }
>   class { 'motd':            }
>   class { 'pam':             }
>   class { 'issue':           }
>   class { 'issuenet':        }
>   class { 'limits':          }
>   class { 'timezone':        }
>   class { 'profiled':        }
>   class { 'pulpconsumer':    }
>   class { 'resolver':        }
>   class { 'aide':            }
>   class { 'autofs':          }
>   class { 'vmtoolsd':        }
>   class { 'ntpd':            }
>   class { 'postfix':         }
>   class { 'auditd':          }
>   class { 'sshd':            }
>   class { 'idmclient':       }
> }
> 
> However, it's now become apparent that I need to exclude the grubipv6disable 
> from some nodes (all have idm0 in their hostname).
> 
> What is the best way (or the less complicated) to achive this?
> 
> Thanks in advance.
> Dan.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/e0226cb0-a8d9-4767-afa7-093c89358063n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/puppet-users/e0226cb0-a8d9-4767-afa7-093c89358063n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/5C81F8B8-E73D-4725-9907-4AA7071F2067%40gmail.com.

Reply via email to