I barely know enough Puppet to ask this question.
I think I understand that the configuration for a particular node would consist of a collection of modules, with some node-specific glue. From the tutorials and documentation, it appears that the node-specific resources would be in a manifests/site.pp file, in node /nodename/ { }
resources, with "includes" for the relevant classes, and resources to make node-specific configuration changes.
Now enter an External Node Classifier (ENC) such as theForeman.
From my reading of the ENC documentation, I COULD use node /nodename/ { }
resources in a site.pp, but I can't declare any new resources. It's basically not recommended. The generated YAML is all just includes and variable settings.
So what does one do for configuration specific to a given node or a host group -- the wiring that integrates all your included classes?
Do you end up creating a class that's specific to the node? Where do you put that class, in a node-specific module? Or do you make a catch-all module for your site-specific configuration with classes that can be assigned to a specific node?
One approach to this is expressed in Designing Puppet – Roles and Profiles. The basic tenets are as follows:
I am assuming you are telling Foreman to import from a puppet master, if so I would suggest setting up your puppet dir like this:
you would then include this line in the site.pp file:
Then, in default.pp create your base server:
Then in another file under nodes, say web.pp you could include that and then set the directives for all web servers like so:
You can even chain inherits like in this db.pp file: