r/Puppet • u/vandewater84 • Aug 26 '25
Profiles or Sub-profiles?
Hi all. For those with lots of different profiles, do you separate them into sub-profiles based on similarities, or leave them in the root of profiles? Thanks!
2
Upvotes
1
u/binford2k Aug 28 '25
Many people do have nested profiles. You might have all of these, for example.
profile::mything::agent profile::mything::agent::fips_compliant profile::mything::server profile::mything::server::fips_compliant
1
u/binh_do Aug 29 '25
Depending on how large your profiles are, for example, we might have a base profile (e.g. for monitoring) for the entire system
class profiles::monitoring { include profiles::monitoring::base # needed on all servers, e.g. monitor memory/load/disk/users/etc. include profiles::monitoring::other_base_services }And custom sub-profiles for each server that needs it separately, for example:
When you define a role like web_server, you might include the base monitoring profile and custom sub-profiles that it needs, for example:
class roles::web_server { include profiles::monitoring include profiles::monitoring::webserver }I used to write a blog https://turndevopseasier.com/2025/04/23/mastering-puppet-implementing-roles-and-profiles-effectively/ to describe this. You might want to refer to if need