I created a chef recipe which has the installation of a specific rpm mentioned in it. This rpm has a version number which needs to be loaded dynamically from a properties file (which is itself created dynamically). This chef recipe then needs to be loaded into the chef server.
remote_file "Core_feature.rpm" do
path "#{src_loc}core_feature_v91-2.noarch.rpm"
Here, v91-2
is the value which needs to go in dynamically into the recipe, by reading from a properties file.
Is this achievable? If yes, how do I go on to implement it.(Have no idea on ruby)!
Best Answer
Edit: complete rewrite due to down-voting but without more information I'm not sure what exactly I'm correcting so here is working code that can be copied and pasted.
Assuming contents of properties file placed in /tmp/versions.properties and looks like the following:
Chef Cook book
As a bonus option if you are working strictly on *nix the following works without lazy:
I still used the original premise of the links in the first two posts referenced: