I have a few basic recipes started, and can deploy them to a vagrant
server, using chef server. It’s a steep learning curve, but I think
I’m getting it figured out.
I now need to plan where the domain attributes live. Thanks for helping
out a chef newbie!
For now, I’m looking at many rails projects, staging and production
environments, and various nodes they may live on. My question is, where
is the best place to store the mapping of these combinations? node
attributes? data bags? I need to be able to say:
project: foo, environment: staging, node: node1
project: foo, environment: production, node: node2 (additional
attributes like sendgrid pw)
project: bar, environment: staging, node: node1 (additional attributes,
project: bar, environment: production, node: node3 (additional
attributes delayed job)
and so on. I can see how the recipes can look for these attributes and
take action on them… But it’s not clear where to put them. I want it
in my git repo though, so we can track the changes over time. right?
At one point I thought the node was the place, but in researching I’m
not clear if knife node from file is safe - it loked like that replaced
Data bags could do it, although I got the impression the were for
credentials, not the whole configuration. What is the convention here?
Also, I don’t see much information on how to handle removal - lets say
project foo above is terminated. Just deleting it from the node or
data bag is not enough. do I need to make a special slot for removals,
and have the recipe update the attribute when it has removed it?