- From: AJ Christensen <
>
- To:
- Subject: [chef] Re: Cookbook versions on node
- Date: Wed, 8 Feb 2012 15:41:12 +1300
Why don't you use environments built in cookbook version locking for
this, instead of trying to do it from a recipe?
You can make 'freeze' the default by chucking it in your knife.rb
http://wiki.opscode.com/display/chef/Environments#Environments-cookbookversions
Cheers,
--AJ
On 8 February 2012 15:36, Peter Donald
<
>
wrote:
>
Hi,
>
>
I would like to enforce certain cookbook version requirements on
>
cookbooks in different environments from within a recipe.
>
>
i.e. All cookbooks on "production" environment must have an even minor
>
version. (i.e. 10.0.2 is valid but 10.0.3 is not). I also want to
>
require that cookbooks be locked or not. (i.e. cookbook referenced in
>
production environments must be frozen).
>
>
Doing something like
>
>
node.run_list.expand(node.chef_environment).recipes.with_versions.each
>
do |recipe|
>
p recipe
>
end
>
>
will only include the versions if they have been explicitly set and
>
will not allow me to check to see if the version is locked.
>
>
Anyone have a good idea how to do this?
>
>
--
>
Cheers,
>
>
Peter Donald
Archive powered by MHonArc 2.6.16.