[chef] Re: How to force immediate execution of LWRP calls?


Chronological Thread 
  • From: Jesse Nelson < >
  • To: chef < >
  • Subject: [chef] Re: How to force immediate execution of LWRP calls?
  • Date: Thu, 21 Mar 2013 22:36:34 -0700

You can ensure your ordering with notifications and immediate actions

foo_resource "foo" do
  notifies :create, "template[bar]", :immediately 
end




On Thu, Mar 21, 2013 at 11:52 AM, Peter Loron < " target="_blank"> > wrote:
I have a recipe I'm working on that installs a system of software to Windows machines. I've written a LWRP to handle installing and uninstalling the Windows services that we use. There are up to a dozen that can be installed on a client machine, depending on its role, etc. I have the details of the services in a hash in the recipe attributes, and am iterating through that, calling the uninstall and install LWRPs. I need to do things in a specific order:

1. Uninstall services
2. Modify files, permissions, user accounts, etc.
3. Install services

Currently, the chef-client (Chef 11.2) run is running all of the install/uninstall calls together at the end of the run.

How can I force execution in the order calls are made in the recipe?

I've looked at notifications, but it seems very clunky to have to explicitly define each resource with no action, and then do some kind of call with a 'notify :install'…

Suggestions from the hive mind?

Thanks!

-Pete




Archive powered by MHonArc 2.6.16.

§