Copy complete directory to the node

Hello Professionals,

Require help to copy the whole directory from Artifactory to the node, currently i'm using this but not successful. Can someone please help me how to achieve this ?

remote_directory 'F:\GS\drm\MC' do
source "https://artifactory.com//gs_dev//MC"
action :create
not_if { ::Dir.exist?('F:\GS\drm\MC') }
end

This resource creates the directory MC but nothing gets pulled from the Artifactory throws an error :
Error executing action create on resource 'remote_directory[F:\GS\drm\MC]'

while this is a common request it's not really something chef does. There's https://docs.chef.io/resource_remote_directory.html but it requires the directory in question live in the cookbook, probably not useful to you. The usual trick here is to create or dynamically assemble a list of the contents of said folder and loop on it with remote_file resources, something like this:


%w(foo.tar bar.tar).each do |file|

remote_file file do

source "[https://blah.tld/ze_path/#{file}](https://blah.tld/ze_path/#{file})"

*snip*

end

end

I found this link, which is very helpful to me, maybe you will find it helpful:

https://stackoverflow.com/questions/19221252/how-to-move-copy-files-locally-with-chef