Pulkit
Pulkit

Reputation: 4084

Error while copying war file from workstation to client node?`

Hi I am using chef for deployment, I have created a war file on my chef workstation and copied it to my templates folder of cookbook chef-workstation now I have written a simple recipe to copy it to my client here is the recipe

template "/opt/tomcat7/webapps/SampleProject.war" do
  source "SampleProject.war"
end

Now if I run the recipe from my chef-workstation using knife ssh it is unable to copy the war file

 knife ssh 'name:staging2.akosha.com' 'chef-client' -x root -P

knife ssh

but if I give some other file like *.txt it copies the file successfully.

Upvotes: 2

Views: 254

Answers (1)

StephenKing
StephenKing

Reputation: 37580

I haven't seen a reference for that anywhere, but you shouldn't use the template resource for binaries - the same happened to me also. It seems that the erb-processing flips some bits.

Instead, use the cookbook_file resource, or better the remote_file, to avoid polluting your Chef server with large artifacts (which do not really belong there).

Upvotes: 1

Related Questions