[chef] Re: Re: using cookbook_file


Chronological Thread 
  • From: jfotop < >
  • To:
  • Subject: [chef] Re: Re: using cookbook_file
  • Date: Wed, 24 Oct 2012 02:52:32 -0700 (PDT)


That didn't work for me... I beleive because during the compile phase, the 
file
doesn't yet exist. So what I did is what is explained in:
http://wiki.opscode.com/display/chef/Evaluate+and+Run+Resources+at+Compile+Time
What it does is it executes these specific resources before the chef run
reaches the execute phase. I beleive that the file creation block should be
specified in your recipe before the resource that executes that binary, so it
is first copied to your system and then executed.
In your case, you should try something like:
firstdir = directory "/some/dir" do
  action :nothing
end
 firstdir.run_action(:create)

bin_file = cookbook_file "/some/dir/binfile" do
    action :nothing
end
bin_file.run_action(:create)

execute "binfile" do
    command "/some/dir/binfile"
    action :run
end

..or something like that...


  • [chef] Re: Re: using cookbook_file, jfotop, 10/24/2012

Archive powered by MHonArc 2.6.16.

§