ruby - How to select thousands of file in chef recipe -


i have lot of csv files should placed in server.

so put in directory my-cookbook/files/default/ , want load csv files using dir.glob method, don't know how set proper relative path it.

dir.glob("#{relative_path}/*.csv").each |file|   cookbook_file "/var/foo/#{file.basename(file)}"     source file.basename(file)   end end 

i tried dir.glob("*.csv"), didn't work.

how can load files in files/default directory?

this isn't how chef designed used. better off putting files in git repo or remote tarball , using things git or remote_file resources download them. cookbook_file hack small, one-off things. don't use much, recommend same.


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -