How to freeze the cookbook based upon the chef environment?


#1

Hi Chef fellas!

On my chef-server, I’ve a rails app running in chef’s production env.

Now I want to tweak and test the configuration of the unicorn in the chef environment in a separate instance.

When the chef-client of the production node runs, it checks in the WIP cookbook/recipes and try to apply. Since the tweaks is not finalized, it might break the running production app.

So, how can I freeze the cookbook/recipe just for the node/chef production environment only??


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


#2

Use the cookbook_versions method in your production environment file. So,
something like:

cookbook_versions {“unicorn” => “= x.y.z”, “rails” => “~> x.y”}

See:
http://wiki.opscode.com/display/chef/Environments
http://wiki.opscode.com/display/chef/Version+Constraints

Matt Moretti
On May 5, 2012 7:50 AM, “Sachin Sagar Rai” millisami@gmail.com wrote:

Hi Chef fellas!

On my chef-server, I’ve a rails app running in chef’s production env.

Now I want to tweak and test the configuration of the unicorn in the chef
environment in a separate instance.

When the chef-client of the production node runs, it checks in the WIP
cookbook/recipes and try to apply. Since the tweaks is not finalized, it
might break the running production app.

So, how can I freeze the cookbook/recipe just for the node/chef production
environment only??


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow http://www.sparrowmailapp.com/?sig


#3

Thanks.


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Saturday, May 5, 2012 at 8:25 PM, Matthew Moretti wrote:

Use the cookbook_versions method in your production environment file. So, something like:
cookbook_versions {“unicorn” => “= x.y.z”, “rails” => “~> x.y”}
See:
http://wiki.opscode.com/display/chef/Environments
http://wiki.opscode.com/display/chef/Version+Constraints
Matt Moretti
On May 5, 2012 7:50 AM, “Sachin Sagar Rai” <millisami@gmail.com (mailto:millisami@gmail.com)> wrote:

Hi Chef fellas!

On my chef-server, I’ve a rails app running in chef’s production env.

Now I want to tweak and test the configuration of the unicorn in the chef environment in a separate instance.

When the chef-client of the production node runs, it checks in the WIP cookbook/recipes and try to apply. Since the tweaks is not finalized, it might break the running production app.

So, how can I freeze the cookbook/recipe just for the node/chef production environment only??


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)