Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I've never tried databags, but that's probably because I find everything apart from chef-solo a little too complicated. Which is why I'm using chef recipies with a service called <a href="http://www.scalarium.com/" rel="nofollow">Scalarium</a>.</p> <p>So the issue with passwords, or e.g. private keys and all kinds of other credentials is a pretty tough one. I too have a bunch of recipes where passwords need to be created, or set correctly.</p> <p>Usually what I do is, I specify what the scalarium folks call <em>custom json</em>. This json is similar to the <code>node.json</code> some people give to chef-solo using <code>chef-solo -j node.json</code>.</p> <p>So e.g. in my <em>custom json</em> on Scalarium web interface, I have the following:</p> <pre><code>{"super_secure_password":"foobar"} </code></pre> <p>What this does is, my <strong>super secure password</strong> is available during my chef run in <code>node[:super_secure_password]</code> and I can use it in recipes or templates.</p> <p>This works fine as long as I only deploy my server using Scalarium but we also use our recipes in local vagrant boxes for a development environment and easier testing. And when I use vagrant (or even chef-solo by itself), I don't have access to the <em>custom json</em> on Scalarium.</p> <p>This is what I do to fix that, in <code>my_recipe/attributes/default</code>:</p> <pre><code>set_unless[:super_secure_password] = "test123" </code></pre> <p>This means that when my recipe is run outside of scalarium, the password is still available in <code>node[:super_secure_password]</code> and my recipes work and so on. When the recipe is executed in the scalarium context, it will not override what they provide.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload