How can attributes be organized in Chef to support multiple, isolated, clusters of nearly identical servers in an environment?
My organization, and I assume many alike, has several staging instances. Different staging instances need to use different database connections and hostnames and little things like that, but otherwise they're identical. In a world where one staging instance = 1 server, you can easily put staging specific attributes in a Chef environment called staging, and you can define instance specific attributes on the node itself.
But what happens when every instance of staging is more than one server? Say we have several different services on different nodes that talk to each other and form an instance of an application.
I can't create an environment for each of these instances, as a node can only be in 1 environment and I don't want to duplicate all the shared attributes between them. Likewise, I don't want to duplicate all the instance/cluster specific attributes on each node.
Should I create a role for each of these instances that just has the instance/cluster specific config? Should I create a cookbook for each of these instances?
I've been looking through blog posts and things but haven't found anything addressing this.