# Re: RE: Re: Passing variables between recipes?

**URL:** <https://discourse.chef.io/t/re-re-re-passing-variables-between-recipes/6096>\
**Category:** Chef Infra (archive)\
**Created:** [December 19, 2014, 10:17am UTC](https://discourse.chef.io/t/re-re-re-passing-variables-between-recipes/6096 "2014-12-19T10:17:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tensibai](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/tensibai/32/29_2.png) [@Tensibai](https://discourse.chef.io/u/Tensibai)\
**Post date:** [December 19, 2014, 10:17am UTC](https://discourse.chef.io/t/re-re-re-passing-variables-between-recipes/6096/1 "2014-12-19T10:17:19Z")

</div>

See AJ message, use node.Run\_state to store your values within a run

Le 19 déc. 2014 10:21, Kevin Keane Subscription \<subscription@kkeane.com\> a écrit :

> Yes, I know about encrypted data bags, but it's code smell. I want the application cookbook to be generic, and not depend on a particular data bag or data bag structure.
> 
> Kevin Keane
> 
> The NetTech
> 
> http://www.4nettech.com
> 
> Our values: Privacy, Liberty, Justice
> 
> See https://www.4nettech.com/corp/the-nettech-values.html
> 
> > -----Original message-----
> > 
> > **From:** [klum\_tz@ukr.net](mailto:klum_tz@ukr.net) \<klum\_tz@ukr.net\>
> > 
> > **Sent:** Friday 19th December 2014 0:53
> > 
> > **To:** [chef@lists.opscode.com](mailto:chef@lists.opscode.com)
> > 
> > **Cc:** [chef@lists.opscode.com](mailto:chef@lists.opscode.com); [chef@lists.opscode.com](mailto:chef@lists.opscode.com)
> > 
> > **Subject:** [chef] Re: Passing variables between recipes?
> > 
> > Data bag actually has facility to code password etc.  
> > So it will not be reviled.
> > 
> > And it can be easily accessed from any node. And data is being saved only on Chef server side.
> > 
> > --- Оригінальне повідомлення ---
> > 
> > Від кого: "Kevin Keane Subscription" \<subscription@kkeane.com\>
> > 
> > Дата: 19 грудня 2014, 10:32:46
> > 
> > > I'm sure that this must be an FAQ but I can't really find the answer.
> > > 
> > > I am working with an application-cookbook/wrapper-cookbook pattern. Usually, in this pattern the wrapper cookbook sets up some attributes, and then calls the application cookbook to do the work.
> > > 
> > > In my case, I do not want to use attributes to pass the data from the wrapper to the application cookbook. Specifically, I dont' want the data to be saved in the node (the data in question is the password to a MySQL database).
> > > 
> > > I also would like to avoid using a data bag simply because it seems like code smell. Only the wrapper cookbook should "know" where the data is coming from.
> > > 
> > > What are my options?
> > > 
> > > Kevin Keane
> > > 
> > > The NetTech
> > > 
> > > [http://www.4nettech.com](http://www.4nettech.com)
> > > 
> > > Our values: Privacy, Liberty, Justice
> > > 
> > > See [https://www.4nettech.com/corp/the-nettech-values.html](https://www.4nettech.com/corp/the-nettech-values.html)

---

<div class="post-metadata">

**Author:** ![Lamont\_Granquist](https://avatars.discourse-cdn.com/v4/letter/l/d26b3c/32.png) [@Lamont\_Granquist](https://discourse.chef.io/u/Lamont_Granquist)\
**Post date:** [December 19, 2014, 5:53pm UTC](https://discourse.chef.io/t/re-re-re-passing-variables-between-recipes/6096/2 "2014-12-19T17:53:54Z")

</div>

+1 on node.run\_state. i don't know where you're getting the password  
'from' but if you don't need to persist it to the chef server, then  
don't, and just use the run\_state.

On Fri Dec 19 02:17:19 2014, Tensibai Zhaoying wrote:

> See AJ message, use node.Run\_state to store your values within a run
> 
> Le 19 déc. 2014 10:21, Kevin Keane Subscription  
> [subscription@kkeane.com](mailto:subscription@kkeane.com) a écrit :
> 
> ```
> Yes, I know about encrypted data bags, but it's code smell. I want
> the application cookbook to be generic, and not depend on a
> particular data bag or data bag structure.
> 
> Kevin Keane
> 
> The NetTech
> 
> http://www.4nettech.com
> 
> Our values: Privacy, Liberty, Justice
> 
> See https://www.4nettech.com/corp/the-nettech-values.html
> 
> -----Original message-----
> *From:* klum_tz@ukr.net <klum_tz@ukr.net>
> *Sent:* Friday 19th December 2014 0:53
> *To:* chef@lists.opscode.com
> *Cc:* chef@lists.opscode.com; chef@lists.opscode.com
> *Subject:* [chef] Re: Passing variables between recipes?
> 
> Data bag actually has facility to code password etc.
> So it will not be reviled.
> 
> And it can be easily accessed from any node. And data is being
> saved only on Chef server side.
> 
> --- Оригінальне повідомлення ---
> Від кого: "Kevin Keane Subscription" <subscription@kkeane.com>
> Дата: 19 грудня 2014, 10:32:46
> 
> I'm sure that this must be an FAQ but I can't really find
> the answer.
> 
> I am working with an application-cookbook/wrapper-cookbook
> pattern. Usually, in this pattern the wrapper cookbook
> sets up some attributes, and then calls the application
> cookbook to do the work.
> 
> In my case, I do not want to use attributes to pass the
> data from the wrapper to the application cookbook.
> Specifically, I dont' want the data to be saved in the
> node (the data in question is the password to a MySQL
> database).
> 
> I also would like to avoid using a data bag simply because
> it seems like code smell. Only the wrapper cookbook should
> "know" where the data is coming from.
> 
> What are my options?
> 
> Kevin Keane
> 
> The NetTech
> 
> http://www.4nettech.com
> 
> Our values: Privacy, Liberty, Justice
> 
> See https://www.4nettech.com/corp/the-nettech-values.html
> 
> ```
