[chef] Re: Need to pass argument from recipe to another in cookbook


Chronological Thread 
  • From: Lamont Granquist < >
  • To:
  • Subject: [chef] Re: Need to pass argument from recipe to another in cookbook
  • Date: Mon, 22 Sep 2014 10:02:23 -0700


You probably just need a directory resource that notifies another resource when it creates the directory.

On 9/22/14, 2:56 AM, 

 wrote:
Hi,

I had a cookbook with multiple recipes, in one of them having resources like

Path /root/chef-repo/cookbooks/rollback/recipes/default.rb

ruby_block "Create a directry for backup" do
   block do
   FileUtils.mkdir node['backup_path'] unless Dir.exists? node['backup_path']
   $s=FileUtils.mkdir node['new_directory']
   puts "directory#{$s}"
   end
end


I need to pass this global variable $s  to another chef resources in another
recipe like Path /root/chef-repo/cookbooks/rollback/recipes/xxxx.rb, if is is
possible how can i get that value during at run time or in any other way?



Thanks in advance,
Ganesan.A




Archive powered by MHonArc 2.6.16.

§