Is it possible to reference multiple versions of a Chef cookbook within a recipe like the following where a recipe in one cookbook (foo) references multiple versions of a recipe in another cookbook (bar) where the version variable is populated before this block?
begin case version when "" include_recipe "cookbook-bar" when "1.0.0" include_recipe "[email protected]" when "1.0.1" include_recipe "[email protected]" else raise "Invalid Version: " + version end rescue Chef::Exceptions::CookbookNotFound raise "The Specified Cookbook Was Not Found: [email protected]" + version end
metadata.rb file I have set the dependency like the following to hopefully pull in versions
depends "cookbook-bar", "<= 1.0.2"
But when I run it I still get the
CookbookNotFound error for versions