I am wondering if there is a resource to download multiple files from remote using chef resource. I want to use:
remote_file 'Download remote file' do
path /opt/
source http:///xxx
mode '0644'
action :create
end
...for one file. What if I want to download multiple files in a same place with different urls? Or how can I modify this resource to make multiple downloads which have different URLs?
This is how I added attributes in recipe:
node['file']['name'].each do |pkg|
remote_file "path/plugins/#{pkg}" do
source "node['file']['url']/#{pkg}"
action :create
end
end
in attributes
default['file']['name'] = %w(
xx-2.0.jar
xx-2.jar
xx.jar
)
remote_directory
resource, documentation : docs.chef.io/resource_remote_directory.html