Foreman use a puppet module parameter for another module


this is not a real problem but maybe you can tell me a better way to manage this situation.

I have 2 Puppet Modules for testing: logrotate and apache2. I wrote the rule for logrotate to rotate apache2 log files.
Assigned them to a apache webserver and it works perfectly. Now I have a testing hostgroup and I assigned the modules.
As expected every host in the hostgroup has now a rule for apache2 log files.
And here is now my Problem. Is there a way to configure a module for example apache2 to use the class logrotate and I can skip to configuration for apache in the logrotate configuration.
So the rule for apache logs are only applied when the module apache is assigned?
Like in puppet “include class logrotate” and then wrote you rule definition?

Foreman + Smart Proxies are on 1.24.2 on CentOS 7.7.1908

I am using a new hostgroup and everything is working. It’s a little bit more management but always better than manual config 10 servers.