Machine Roles

I’ve been struggling with the same issue as posted here:
In short, it’s about how to restrict app deployment to certain machines, when you’re dealing with a lot of apps and only a handful of machines, deployed more or less haphazardly.

The answer given in the thread above is “use machine roles, even if you’re going to use a lot of them”.

This directly contradicts the warning on the bottom of the Machine Roles documentation:

“By definition, a role is “the function assumed by a thing in a particular situation”. Roles are not Environments or OS versions. Try to use roles to tag servers by their utility and watch out if you find yourself putting more than 3 roles on the same server.”

So should I use roles to restrict app deployment, even if it means using a lot, or is that conceptually wrong?


Hi Uli,

Thanks for getting in touch! There do seem to be contradictions in both our answers and the documentation. I do not see it as a contradiction so much as it is lacking examples to explain the stance the documentation takes.
There are appropriate times to use roles, and I think you are on the correct path with why you need them. We have notes in our documentation with warnings because we have seen setups that have a role for each step in each project which is overkill.

The general rule for roles is as follows. Their purpose is to determine which machines should be used for each step. If there are machines that have many roles, that is okay so long as there are no sets of machines that are duplicated when they are queried via individual roles.
You never have to have roles that are unique for an environment as we only deploy to one environment at a time, and steps themselves can be restricted to environments.

Hopefully that helps explain the differences you found and helps you decide when to use roles.

Please let me know if you have any further questions or I can explain this in greater detail.