A node is simply a server. It sounds like in your situation, you may have multiple servers for each customer. So the statement about “map a node to a given customer and stage and keep the config values there” doesn’t seem to make too much sense to me.
I actually use data bags for that purpose - one data bag per customer, in your situation. Then write a “dispatcher” cookbook that reads the information from the data bag, and uses it to determine how to configure this particular node.
Editing files is something chef is extremely poor at. Doesn’t matter if it’s prop, xml, … It’s just not in chef’s philosophy (although there are some ugly ways to do it if you really, really, need to).
Chef is organized around the concept of components/packages/… Basically, you create a cookbook (or download an existing one from supermarket.getchef.com) to completely manage a particular component of your system from start to finish. For instance, postfix. Generally, the cookbook will throw away any existing configuration files, and generate a new one from scratch.
Our values: Privacy, Liberty, Justice
Thanks for reinforcing my belief in Chef.
The deployments and nodes are managed by a single admin team as the customizations are hosted and managed by us.
My worries were mainly about managing the databags/environment specific values - but a bit more of googling led to me believe that this is one use of environment variables/databags.
Until we move to a situation where complete files can be managed and pushed out for each stage and client I think it is OK to map a node to a given customer and stage and keep the config values there.
Only hurdle to cross is finding a cookbook/recipe which would handle prop and xml file edits-clumsy but something we have to do.
I was afraid our usage was more of a wrapper on ANT like approach - something that chef enthusiasts might question.
The only question is how isolated the environments need to be. Generally speaking, you would probably want to set up ONE chef server for all your clients. That means that each client can see the configuration information for all the other clients.
You could also set up a separate chef server for each client. It can be difficult to keep all these servers consistent, though.
Or you can use a single Chef server with multi-tenant support to ensure isolation. The hosted chef server supports it, and I hear that the new version chef server 12 also has that feature.
Our values: Privacy, Liberty, Justice
From: Vikas Roonwal <email@example.com mailto:firstname.lastname@example.org >
Sent: Monday 10th November 2014 22:43
To: email@example.com mailto:firstname.lastname@example.org
Subject: [chef] Correct use of Chef
This is more of a newbie’s confusion than a dev’s request for help. Just trying to ascertain if Chef is a good choice in the given scenario.
I am part of a services team which customizes a product for client usage.
There are multiple clients and each has their own environment for QA, Staging, Production and Dev.
Since the customization is done on a similar product the build and deployment options are same across.
We have been using ANT and Shell Scripts till now - with a lot of manual intervention and have looked at chef.
Are the following assumptions and usage pattern correct -
- Create 1 environment per customer + environment [QA, Staging,etc.]
- Tie the servers/machines or nodes to these environments
- Use Environment specific databags or properties to pass config data to nodes
- Enable different teams like DB, Networking to populate the relevant config values
- Get each node to install required apps like JBOSS, MySql, etc. and update the config files based on entries in databags [ basically edit xml or prop files]
Any insight or pointers to user experience would be of great help.