Thank you for the help. Is there a philosophical reason why specifying the version number is the better answer? Tying your recipe to a specific version of a package requires more maintenance.
If Chef provided a way to detect the version number of the package it just installed, the recipe could be more generic. From: Daniel DeLeo [mailto:
On Behalf Of Daniel DeLeo On Monday, October 21, 2013 at 6:43 AM, THARP, JOSHUA L wrote:
A few ways to do this: The best way is if you know the version number up front: package "thing" do version node[:my_package][:version] end link "/bin/thing" do to "/opt/my_package/#{node[:my_package][:version]}/bin/thing" end If that's completely unpossible for you, then you need to use a little bit of magic to get the link path during the converge phase, e.g. link "/bin/thing" do # create a lazy resource attribute that will find the path: path_finder = lazy do version = ver = `yum list my-package | grep “my-package” | cut –c 41-55`.strip "/opt/my_package/#{version}/bin/thing" end # set the `to` attribute of the link resource to the lazy-evaluated attribute to path_finder end -- Daniel DeLeo |
Archive powered by MHonArc 2.6.16.