[chef] Helper and Resource Order


Chronological Thread 
  • From: Douglas Garstang < >
  • To:
  • Subject: [chef] Helper and Resource Order
  • Date: Fri, 28 Aug 2015 13:27:21 -0700

I have a default recipe with this:

file '/tmp/foo' do
end
::Chef::Recipe.send(:include, Helpers)
func()



and a helper function in libaries/ with this:

module Helpers
  def func()
    Chef::Log.info("I am here")
  end
end

My chef run in vagrant shows this:

==> node1: [2015-08-28T20:24:53+00:00] INFO: I am here
==> node1: [2015-08-28T20:24:53+00:00] INFO: file[/tmp/foo] created file /tmp/foo


Obviously, the helper function func() is being called and executed before the file resource, even though the order dictates the file resource should run first. How can I ensure a specific order?

Thanks,
Douglas




Archive powered by MHonArc 2.6.16.

§