Created
December 9, 2014 20:13
-
-
Save spheromak/6ee97d558c2598ca86bc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create_service builds a service resource we can notify in the given context | |
def create_service(context=nil) | |
ctx ||= @run_context | |
begin # this avoids resource cloning/recreation | |
ctx.resource_collection.find( "service[#{new_resource.name}]" ) | |
rescue Chef::Exceptions::ResourceNotFound | |
Chef::Log.info 'Creating service resource' | |
s = Chef::Resource::Service.new(new_resource.name, ctx) | |
s.action :nothing | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment