Chef cookbook - copy complete directory from files/default location in cookbook to a new location
<p>I am a beginner to Chef. Can any one please advise if there is a way to copy a directory inside cookbook's <code>files/default</code> directory to a different location.</p>

<p>E.g. I have a directory structure with files <code>a.txt</code> and <code>b.txt</code> in <code>files/</code> directory as follows <code>cookbook_name/files/default/folder-name/[a.txt,b.txt]</code>. I want them both files to be a location <code>/home/user/work/somelocation/folder-name/[a.txt,b.txt]</code></p>

<p>I have tried <a href="https://docs.chef.io/resource_cookbook_file.html" rel="noreferrer">cookbook_file</a> resource as follows:</p>

<pre class="lang-rb prettyprint-override"><code>cookbook_file '/home/user/work/somelocation/' do
  source ['folder-name']
  mode "0644"
  action :create
end
</code></pre>

<p>and</p>

<pre><code>cookbook_file '/home/user/work/somelocation/' do
  source ['folder-name/a.txt',''folder-name/b.txt'']
  mode "0644"
  action :create
end
</code></pre>

<p>I am aware of other means of copying files between arbitrary directories by looping through, but I am keen to know if there is more elegant way to handle directories akin to how cookbook_file handles files from standard folders inside cookbook's <code>files/default</code> directory.</p>