I have a set of resources that I want to invoke as a single unit, that will
notify other resources if any of the sub-resources would do so.
One such set could be modeled as its own recipe, I want to be able to
include multiple instances in other recipes - and you can only include
another given recipe once.
So I was thinking an LWRP. Say I want to create a group, a user who belongs
to that group, a file owned by that user, and a service that requires that
file to exist, in one swell foop. The provider could look like this:
action :create do
resources = Hash.new 
group “foo” do … end <<
user “bar” do … end <<
file “baz” do … end
resources[:enable] = resources[:start] << service “zoo” do … end
resources.each do |action, res| res.run_action action @new_resource.updated_by_last_action(
@new_resource.updated_by_last_action? || res.updated_by_last_action? )
It seems kind of hacky to force all the resources to run immediately just so
I can query their updated_by_last_action status. Is there a better way?
Mark J. Reed email@example.com