Using Chef roles
Roles provide a way of looking at our infrastructure code as a representation of the functions performed by the servers we associate with them. Said another way, a "web server" role is created and assigned to a server that performs the function of a web server.
The benefit here is functional consistency. Whether your goal is to be able to reproduce a server in the event of failure or upgrade, or to deploy multiple identical servers to load balance a function, using a role will allow you to achieve that functional consistency.
A role's definition can be anywhere between very general, such as "Base" role, to very specific, such as "App-A Inventory Backup PostgreSQL DB Server". It is a common practice to use a role to group functionality that goes together, like all the recipes that should be run on every node grouped in a "Base" role.
Sometimes, servers will be assigned a single role, such as "UI Server". Other times, a...