In discussing roles, I always encourage reviewing
http://www.craigdunn.org/2012/05/239/, the original guideline for the roles
and profiles pattern. It posits that the role, like the profile, is just
another class inside the 'role' module - role::www, role::mail, etc - that
is composed of profile classes - profile::apache, profile::webapp, etc.
Lots of examples in the document. The "rules", which are more like
guidelines, are near the bottom (emphasis mine):
- *A node includes one role, and one only.*
- A role includes one or more profiles to define the type of server
- A profile includes and manages modules to define a logical technical
- Modules manage resources
- Modules should only be responsible for managing aspects of the
component they are written for
Another guideline that has cropped up since 2012 is: If a node requires two
roles, it's time to create a new role that fits that need. So, subroles
would actually be new roles - role::webapp1 and role::webapp2 rather than
assigning role::web and role::app1 to a single node, for example. This
ensures that roles do not become coupled in accidental manners, where
someone wants to tweak a setting for webapp1 that happens to be in
role::web, causing side effects to webapp2.
Going back to your previous email, you also described role::mail where some
nodes are relays. You may need a second role for this, but it is also
possible that one of the profiles (maybe profile::mailapp) or the component
module it calls (postfix or sendmail) accept parameters that indicate
whether a node is a relay or not. In that case, you could use hiera to pass
different values to those parameters for different nodes. I wrote a bit on
the merging of Roles and Profiles with Hiera data at
that may help.
On Wed, Sep 21, 2016 at 3:22 PM, Ivan Arjune <iarj...@gmail.com> wrote:
> Are subroles implemented as a conditional statement within the profile
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
To view this discussion on the web visit
For more options, visit https://groups.google.com/d/optout.