I've written a simple custom service provider for monit that inherits from the debian provider. Since this is running on debian systems, I want to use the debian "enable" to enable/disable running at boot, but I want monit to manage the running service rather than puppet.
Puppet::Type.type(:service).provide :monitdummy, :parent => :debian do
desc <<-'EOT'
Dummy provider for monit; always reports status as "running" so puppet
doesn't manage the running state
EOT
confine :exists => "/usr/bin/monit"
def startcmd
[ "/bin/true" ]
end
def stopcmd
[ "/bin/true" ]
end
def restartcmd
[ "/bin/true" ]
end
def statuscmd
[ "/bin/true" ]
end
end
It works for what I need. My problem is that this has now become the default provider on my system, according to facter:
# facter -p | grep service
service_provider => monitdummy
I've tried adding a call to "defaultfor" like this:
defaultfor :operatingsystem => 'none'
...but that doesn't have any effect, I guess because it's inheriting the defaultfor from the debian provider and there can be multiple?
I realize I could set debian as the default provider with "Service { provider => 'debian' }" in a high-level manifest, but that seems less than ideal since it short-circuits puppet's provider selection-- what I'd really like would be for a way to ensure that my custom provider is never the default.
Is there any way to do this?