Rules for role classes
The rules for role classes Here are the rules for writing role classes:
- The only thing roles should do is declare profile classes with include. Don’t declare any component classes or normal resources in a role.
- Optionally, roles can use conditional logic to decide which profiles to use. They can also include other role classes, as long as those roles obey these same rules.
- Roles should not have any class parameters of their own.
- Roles should not set class parameters for any profiles. (Those are all handled by data lookup.)
- The name of a role should be based on your business’s conversational name for the type of node it manages.
This means that if you regularly call a machine a “Jenkins master,” it makes sense to write a role named role::jenkins::master. But if you call it a “web server,” you shouldn’t use a name like role::nginx — go with something like role::web instead.