Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get a full path of the running cookbook in the RightScale chef recipe?

From inside my currently executing cookbook recipe I'd like to get access to it's "current" location on my executing machine.

I need this to get access to it's cached directory structure.

I have a feeling it's located somewhere inside "node[]" but I can't find any documentation about its structure at all.

Any advise?

Thanks

like image 922
IgorM Avatar asked Feb 19 '23 00:02

IgorM


1 Answers

Just found the solution by inspecting the "run_context" instance:

ruby_block "reload_client_config" do
  block do
    puts "HERE!!!!!  -> " + run_context.cookbook_collection[cookbook_name].root_dir
  end
  action :create
end

This came to me after seeing this thread - Get deployed cookbook version

like image 162
IgorM Avatar answered Feb 24 '23 04:02

IgorM