nagarajabalur / mywordpress

0 stars 0 forks source link

Always download into Chef Cache #4

Closed gau1991 closed 8 years ago

gau1991 commented 8 years ago

Instead of using /tmp use Chef cache for downloading using remote_file resource.

# download the latest wordpress tar file
remote_file '/etc/latest.tar.gz' do
  source 'http://wordpress.org/latest.tar.gz'
  owner 'root'
  group 'root'
  mode '0755'
end
nagarajabalur commented 8 years ago

using chef cache to download the remote files:

filepath = Chef::Config[:file_cache_path] + '/latest.tar.gz'

remote_file filepath do source sourceurl owner 'root' group 'root' mode '0755' end