Reputation: 4084
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 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
but if I give some other file like *.txt it copies the file successfully.
Upvotes: 2
Views: 254
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