简体   繁体   中英

Chef, related path from cookbook to file storage

Is it possibile to get absolute path to cookbook directory(I don't need path to cache).

What I want to do? My structure:

Chef
    -Cookbooks(tomcat, java, etc.)
    -Profiles(json files with configs)
    -Resources(zip files with programs)
    runScript0.bat
    runScript1.bat
    ....

How can I get path to Resources folder from recipes, I need to get files from this folder w/o hardcodded path. Of course I can download programs from svn/git, but I need this option too.

The structure you describe is not inside a cookbook so those files do not exist as far as Chef is concerned. Even inside a cookbook, you need to use a cookbook_file or remote_directory resource to write to a known place first.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM