[chef] Include recipe if file exists.

Chronological Thread 
  • From: Doug Garstang < >
  • To:
  • Subject: [chef] Include recipe if file exists.
  • Date: Thu, 8 Oct 2015 09:17:10 -0700


Trying to do a conditional include_recipe based on a file existing. Doesn't work due to compile/converge stage stuff.

A workaround was suggested here by the folks that should know:

However, it doesn't work, just as someone else responded to the ticket with. They did not get a reply.

So, just to be clear, as suggested, this does not work:

unless ::File.exists?("/etc/foo/bar")
  include_recipe "foo::bar"


Archive powered by MHonArc 2.6.16.