[chef] Re: Searching files/ to see if file exists


Chronological Thread 
  • From: Lamont Granquist < >
  • To:
  • Subject: [chef] Re: Searching files/ to see if file exists
  • Date: Fri, 02 May 2014 13:27:39 -0700

On 5/2/14, 9:20 AM, Julio Lajara wrote:
Hi all, I need to determine if a file is included/exists in the files/* subdir under any appropriate folder for the current node, is there any way I can do this? I looked through the chef code and see theres a get_filename method as part of the cookbook code, is this usable from within cookbooks and if so can someone point to an example of how it would be used?

Thanks,
It might be better to know exactly what you're trying to accomplish in context. You're going to run into lazy cookbook loading issues almost right away and in general the solution you're heading towards is likely to be fairly brittle. There might be a better way to solve the bigger problem that you're trying to solve that doesn't go down this hole. And if there isn't a better way to solve the bigger problem then there might be better helper methods to engineer and give to you to make it easier to do things like this...




Archive powered by MHonArc 2.6.16.

§