[chef] Re: Re: cookbok file-- copy only if new


Chronological Thread 
  • From: Jordan Dea-Mattson < >
  • To:
  • Subject: [chef] Re: Re: cookbok file-- copy only if new
  • Date: Thu, 12 Sep 2013 13:23:19 -0700

Hi Manoj -

If I am understanding what you are trying to do, I don't believe that using :create_if_missing will work for you (which is consistent with what you suspect).

My understanding is that you want to do the following:

+ Create a .war file that has the same name for every version of the file.
+ Only copy the file when there is a new version
++ But that new version will have the same name

Is that correct?

If so, I believe that using `remote_file` is your best option. It will allow you to specify a checksum and will only copy the file if the checksum matches what you specify.

Alternatively, you could use cookbook_file, but use a conditional that requires they checksum you calculate is different from what is deployed.




On Thu, Sep 12, 2013 at 1:00 PM, Alan Ivey < " target="_blank"> > wrote:
The :create_if_missing action will only put the file in place if it doesn't already exist.

The .war file can be in the cookbook/files/default/file_name.war. Then, use the action:

cookbook_file "/destination/path/to/file_name.war" do
  action :create_if_missing"
end




--
Alan Ivey


On Thu, Sep 12, 2013 at 2:29 PM, Manoj Thakkar < " target="_blank"> > wrote:
Hi,

This is what i am trying to do, i build my war file and copy it in the chef cookbook files/default folder and then run chef-client on my deployment node assuming it will copy the new file.

My recipe says cookbook file "file_name" ...... , I ma not sure what should i write it in the action statement
As the war file name will always be the same so create or create if missing does not make sense,

Please help.








Archive powered by MHonArc 2.6.16.

§