# Making available configuration data of Database node to the WebApp node

**URL:** <https://discourse.chef.io/t/making-available-configuration-data-of-database-node-to-the-webapp-node/5527>\
**Category:** Chef Infra (archive)\
**Created:** [July 3, 2014, 4:59am UTC](https://discourse.chef.io/t/making-available-configuration-data-of-database-node-to-the-webapp-node/5527 "2014-07-03T04:59:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Denis\_Weerasiri](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/denis_weerasiri/32/305_2.png) [@Denis\_Weerasiri](https://discourse.chef.io/u/Denis_Weerasiri)\
**Post date:** [July 3, 2014, 4:59am UTC](https://discourse.chef.io/t/making-available-configuration-data-of-database-node-to-the-webapp-node/5527/1 "2014-07-03T04:59:41Z")

</div>

Hi,  
I am trying to learn cookbook language by writing a cookbook to set up a  
LAMP stack in two different nodes for MySQL and PHP.  
I was looking at this

> <https://github.com/aws-samples/opsworks-example-cookbooks/blob/master/phpapp/recipes/appsetup.rb>

  
and it has

variables(  
:host =\> (deploy[:database][:host] rescue nil),  
:user =\> (deploy[:database][:username] rescue nil),  
:password =\> (deploy[:database][:password] rescue nil),  
:db =\> (deploy[:database][:database] rescue nil),  
:table =\> (node[:phpapp][:dbtable] rescue nil)  
)

Does any body knows what this “variable” construct tries to do? I don’t  
understand what is meant by “=\>” and “deploy” means in this recipe.

–  
Thanks,  
Denis

---

<div class="post-metadata">

**Author:** ![Denis\_Weerasiri](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/denis_weerasiri/32/305_2.png) [@Denis\_Weerasiri](https://discourse.chef.io/u/Denis_Weerasiri)\
**Post date:** [July 3, 2014, 5:03am UTC](https://discourse.chef.io/t/making-available-configuration-data-of-database-node-to-the-webapp-node/5527/2 "2014-07-03T05:03:12Z")

</div>

Hi, I could not mention the main focus of my exercise. I am trying to find  
a way to expose some runtime data of a particular node (eg- access  
credentials to MySQL database) to another node (eg- PHP node.). I thought  
the "variable" construct is a mechanism to access dynamic data across  
different nodes.

On Thu, Jul 3, 2014 at 2:59 PM, Denis Weerasiri [ddweerasiri@gmail.com](mailto:ddweerasiri@gmail.com)  
wrote:

> Hi,  
> I am trying to learn cookbook language by writing a cookbook to set up a  
> LAMP stack in two different nodes for MySQL and PHP.  
> I was looking at this  
> [https://github.com/amazonwebservices/opsworks-example-cookbooks/blob/master/phpapp/recipes/appsetup.rb](https://github.com/amazonwebservices/opsworks-example-cookbooks/blob/master/phpapp/recipes/appsetup.rb)  
> and it has
> 
> variables(  
> :host =\> (deploy[:database][:host] rescue nil),
> 
> ```
> :user => (deploy[:database][:username] rescue nil),
> 
> :password => (deploy[:database][:password] rescue nil),
> 
> :db => (deploy[:database][:database] rescue nil),
> 
> :table => (node[:phpapp][:dbtable] rescue nil)
> 
> )
> 
> ```
> 
> Does any body knows what this "variable" construct tries to do? I don't  
> understand what is meant by "=\>" and "deploy" means in this recipe.
> 
> --  
> Thanks,  
> Denis

--  
Thanks,  
Denis Weerasiri

Sent from my iPhone
