I have never tried databags, but this is probably because I find everything but the chef too complicated. That's why I use chef recipes with the Scalarium service.
So, the problem with passwords or, for example, private keys and all sorts of other credentials are quite complex. I also have a bunch of recipes where passwords need to be created or set correctly.
Usually what I do, I indicate that people in scalar mode call user json. This json is similar to node.json , which some people give to the chef using chef-solo -j node.json .
So, for example, in my Scalarium web user json, I have the following:
{"super_secure_password":"foobar"}
What this means is, my super secure password is available during my chef's node[:super_secure_password] , and I can use it in recipes or templates.
This works fine while I only use the Scalarium server, but we also use our recipes in local firewalls for a development environment and easier testing. And when I use a stroller (or even a chef on my own), I don't have access to custom json on Scalarium.
This is what I am doing to fix this in my_recipe/attributes/default :
set_unless[:super_secure_password] = "test123"
This means that when my recipe runs outside the scalarium, the password is still available in node[:super_secure_password] , and my recipes work and so on. When a recipe is executed in a scalary context, it will not override what they provide.
Till Apr 09 '11 at 18:15 2011-04-09 18:15
source share