I'm trying to add a recipe to an existing cookbook (currently at version 0.14.1). I've created the file, incremented the cookbook version (0.15.0) and uploaded to my chef server.
I've verified there are no environment constraints that would prevent my node from receiving this update.
environments/production.rb
name "production"
description "Production environment for servers"
cookbook_versions({
...
"mycookbook" => "~> 0.8",
...
})
And added the new recipe to the runlist of this node.
By all accounts, this should work for me. but for some reason - my nodes will not download the updated version. when I run chef-client
when I look at the metadata.json for the file
/var/chef/cache/cookbook/mycookbook/metadata.json
{
...
"version": "0.14.1",
...
}
it will never go past the 0.14.1 version.
I tried moving the cookbook folder out of the way and re-ran the chef-client
, it re-downloaded all cookbooks, but still downloaded the old 0.14.1 version of the cookbook in question
I've double checked that the versions I've updated do exist on the chef-server, I've even tried showing the new cookbook recipe at the existing version and it returns what I expect
knife cookbook show mycookbook 0.15.0 recipes newrecipe.rb
--Update--
I was able to track down the problem to a random constraing in my environment file on a different cookbook that was holding back the updated version from being downloaded. once I relaxed this version constraint everything worked as I expected.