kosinsk
kosinsk

Reputation: 5

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.

Upvotes: 0

Views: 286

Answers (1)

coderanger
coderanger

Reputation: 54267

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.

Upvotes: 1

Related Questions