summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-02-28 13:58:56 -0600
committerLuke Kanies <luke@madstop.com>2008-02-28 13:58:56 -0600
commit614ab9fcc33a7c4abffc0b407335f4a713f2fabd (patch)
tree748c9275f876a3c4938c46c773f23a02119b5525 /lib
parentbb8051bc406d1da67db8212e852bb36d1368e953 (diff)
downloadpuppet-614ab9fcc33a7c4abffc0b407335f4a713f2fabd.tar.gz
puppet-614ab9fcc33a7c4abffc0b407335f4a713f2fabd.tar.xz
puppet-614ab9fcc33a7c4abffc0b407335f4a713f2fabd.zip
Adding a 'control' parameter to services, for those
service types that need a control variable to enable/disable.
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/type/service.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/puppet/type/service.rb b/lib/puppet/type/service.rb
index c41a7883b..1b625cc41 100644
--- a/lib/puppet/type/service.rb
+++ b/lib/puppet/type/service.rb
@@ -28,6 +28,8 @@ module Puppet
feature :enableable, "The provider can enable and disable the service",
:methods => [:disable, :enable, :enabled?]
+ feature :controllable, "The provider uses a control variable."
+
newproperty(:enable, :required_features => :enableable) do
desc "Whether a service should be enabled to start at boot.
This property behaves quite differently depending on the platform;
@@ -163,6 +165,13 @@ module Puppet
desc "Specify a *stop* command manually."
end
+ newparam(:control) do
+ desc "The control variable used to manage services (originally for HP-UX).
+ Defaults to the upcased service name plus ``START`` replacing dots with
+ underscores, for those providers that support the ``controllable`` feature."
+ defaultto { resource.name.gsub(".","_").upcase + "_START" if resource.provider.controllable? }
+ end
+
newparam :hasrestart do
desc "Specify that an init script has a ``restart`` option. Otherwise,
the init script's ``stop`` and ``start`` methods are used."