Similarly, you probably want to package your recipe as an LWRP and then
foo “bar” do
Or use a not_if, or just bake the File.exist? check into the LWRP.
Since you mention you’ve had compile/converge issues its probably better
to bake the File.exist? check into the idempotency check of an LWRP and
then you always call the LWRP and the provider code simply does
"return if File.exist?("/etc/foo/bar")" and then the calling code is not
responsible for that check and just calls the LWRP.
On 10/08/2015 09:17 AM, Doug Garstang wrote:
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: