[chef] Re: Re: Re: data bags and recipe


Chronological Thread 
  • From: "steve ." < >
  • To: " " < >
  • Subject: [chef] Re: Re: Re: data bags and recipe
  • Date: Tue, 9 Jul 2013 10:51:42 -0700

I did something like this for managing RunDeck SSH key pairs and I can testify that it does, in fact, work.  Data bag items have a couple of tricks to them but the documentation sorted me out.  Due to the way encrypted data bag items are handled, you have to do a few things differently if you're generating one -- essentially, you create a data bag item first, then pass in the encrypted data bag item as payload.  Then you call #save on the containing data bag item and you're all set.

If you aren't already writing these as library functions, I'd suggest doing that for the cookbook.  It does make your recipe a bit more readable ... and, of course, once you're writing pure Ruby in your library you can document it like any other Ruby code.



On Tue, Jul 9, 2013 at 6:35 AM, Dorian Jaminais < " target="_blank"> > wrote:
Hi Sean,

I also do that for most of the data.

My use case here is to store passwords generated on the node to be used by other nodes. We have separated environment for each client with dedicated databags and encryption key so I wanted to leverage this to avoid having the password in plaintext in the node's attribute.


2013/7/9 Sean OMeara < " target="_blank"> >
Hi Dorian.

What kind of data do you need to exchange between nodes?
One strategy I've used in the past is having clients stash data in their own node object and having others search for it.

Something like this may or may not work for you:

stash data:


then search


-s


On Tue, Jul 9, 2013 at 6:40 AM, Dorian Jaminais < " target="_blank"> > wrote:
Hi Chefs,

I was wondering it it was possible to write to a data bag from within a recipe?
I know this is not the main purpose of a data bag but sometimes I need to exchange data between several nodes. I sure can put that data in myself but it'd be better if fully automated.

--
Dorian JAMINAIS
System Administrator
+33 6 95 10 95 37







--
Dorian JAMINAIS
System Administrator
+33 6 95 10 95 37







Archive powered by MHonArc 2.6.16.

§