.
├── manifests
│ └── site.pp
└── modules
└── my_module
├── files
│ └── my_file
├── manifests
│ └── init.pp
└── templates
└── a_template.erb
In site.pp above you can add something like:
node server1 {
include my_module
}
Or you could do something like this:
node default {
include my_module
}
node server1 inherits default { }
Now default could be named 'webservers', 'dbservers' or whatever group of servers you want.
You can even do something like:
node /server\d+/ {
include my_module
}
Here we are just including my_module for all nodes named server1 or 2 or N.
Now there are smarter ways to layout your node definitions and you wouldn't normally include them in the the site.pp but this will give you the idea to start off with - you can put them into a separate nodes.pp file(s) or into something like a Hiera data structure. Anyway, have a look here for more detail on node definitions.
Inside your module you might want to define what servers get what based on things like facts. If so then this might give you some pointers too:
HTH
Den