Instead of adding filters to ‘/usr/share/foreman/config/ignored_environments.yml’.
My suggestion is to update the ‘Configure’ -> ‘Classes’ page to give better control over the classes.
Under the ‘Actions’ column add two extra actions ‘active’ and ‘passive’.
By default when a Puppet module is added to Foreman all classes in that module are added as ‘active’. I.e. Available to be managed by Foreman. Helper classes (not to be manages by Foreman) can then be set to ‘passive’. In the example in 4.2.2. git::install, git::params & git::repo would be set to ‘passive’.
For the GUI - gray out the ‘passive’ classes and add a button/ icon to show/hide the passive classes.
It should be considered an ERROR if the user tries to make a class ‘passive’ if any Smart Variables or Smart Class Parameters have been given a value or an override. This could save a debug nightmare! Can you imagine trying to debug a class value change when the class is hidden?
If for example the users have a module from the Puppet forge that needs parameters changed for their environment I recommend that they update the code for the module or use hiera.
With this setup I believe that Foreman will not have to process any ‘passive’ classes to display and manage the classes or each run of the puppet agent. As this takes the ‘passive’ classes out of the view of Foreman I believe you will see a bit of a performance improvement!
If the user was to set a ‘passive’ class to ‘active’ then I believe Foreman should scan the class as if it has just been imported.