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:
- Uninstall services
- Modify files, permissions, user accounts, etc.
- 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?