On Tue, Dec 21, 2010 at 12:14 AM, Nick Moffitt <n...@zork.net> wrote:

> Nigel Kersten:
> > Can you use the "basic" service provider with fully-specified
> > start/stop/restart commands to achieve what you need?
>
> Are you suggesting that I override the start command to a noop, and make
> sure the restart command works in that scenario?  Thinking that over, it
> has potential.  I suppose it would refrain from starting a crashed
> service, but it would pass the test in type/provider.rb that's been
> causing me grief:
>
>    # Basically just a synonym for restarting.  Used to respond
>    # to events.
>    def refresh
>      # Only restart if we're actually running
>      if (@parameters[:ensure] || newattr(:ensure)).retrieve == :running
>        provider.restart
>      else
>        debug "Skipping restart; service is not running"
>      end
>    end
>
> I think I'll continue to use the fully-specified provider to gain the
> enablement features among other things.
>
> Thank you, that seems eminently sensible!
>

I guess I'm suggesting that you come up with a set of commands for
start/stop/restart that gives you the behavior you want. I'd try and see if
you can achieve this with provider => basic, and if you can, you can then
either:

* write a defined DSL type that abstracts away the complexity in the
commands you're specifying.
* write a native Ruby provider that does the same thing, deliver with
pluginsync.

The first is quicker to scaffold, but means you won't be using "service"
anymore for each resource instance, the second will be a matter of
specifying a specific provider with each "service" resource instance, or as
a resource default.


> --
> You are not entitled to your opinions.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscr...@googlegroups.com<puppet-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to