Wouldn't an attribute suffice to share the location? You have to define where the cookbook_file is going and if you use an attribute to define the target location, it'll be available for other recipes as well.SteveSteven MurawskiCommunity Software Development Engineer @ ChefMicrosoft MVP - PowerShell
http://stevenmurawski.comOn 3/13/2015 4:14:37 PM, Robert Freiberger < " target="_blank"> > wrote:
Hello Chef,I have a recipe that copies a file over from <cookbook>/files/default/myscript.rb to the node locally. Right now I have this hard coded where it's using the name listed in the recipe, but I would like to make this use a variable listed in another recipe.So the end goal would be a recipe like launch_script.rb would call the script copy the file over using the copy recipe, only based upon a variable name listed in the launch_script.rb recipe.From what I found, this is only possible using a node runtime likenode.run_state[:script_1] = "check_httpd.rb"filename = node.run_state[:script_1]But this still requires me to add the "node.run_state[:script_1] added to the copy recipe.Is there any way to send a variable to a recipe without hardcoding the name in the recipe? Or what is really the correct Chef way? Create a new resource?Thanks,Robert
Archive powered by MHonArc 2.6.16.