Same recipe for two teams or two chef recipes for each team

Hello guys,

Today I had a discussion with my colleagues regarding the creation of a chef recipe to deploy a microservice which has a bit different config file based on which team will use it.

My approach is the chef standard one. There should be only one recipe and the deploy should be different based on nodes/environments/tags or some other attributes.

My colleagues opinion is that we should have a recipe for each team (there are two) so there will be no ifs in the recipe and more than that, the two recipes will have slightly different configs as well.

I need some strong motivation to keep only one recipe and I seems to lack the power of conviction.

Could you help me up, please? :slight_smile:
I know that maybe this is not the best place to ask for advices like this, but I thought that I might ask.

Thank you,

Sounds like the microservice will evolve in two at a point (if the two teams have different configs, they’ll soon or late have a different evolution of this service). So maybe two cookbooks could be a way to go.

On a first step if the microservice code us shared I would go for the wrapper cookbook pattern:
Have a cookbook for the microservice deploy and default values and 2 wrapper cookbook (with attributes only) to deploy it (one per team). That way each team will have it’s own config under control and there’s fewer risks of side effects from one on the other.

On your node runlist you’ll set one of the wrapper only, depending on wich team the node is granted to.


Sounds like a good ideea.

Thank you.