summaryrefslogtreecommitdiff
path: root/lib/chef/resource/service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/resource/service.rb')
-rw-r--r--lib/chef/resource/service.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/chef/resource/service.rb b/lib/chef/resource/service.rb
index 849afebad0..616af6cf11 100644
--- a/lib/chef/resource/service.rb
+++ b/lib/chef/resource/service.rb
@@ -24,16 +24,18 @@ class Chef
class Service < Chef::Resource
identity_attr :service_name
- state_attrs :enabled, :running
+ state_attrs :enabled, :running, :masked
default_action :nothing
- allowed_actions :enable, :disable, :start, :stop, :restart, :reload
+ allowed_actions :enable, :disable, :start, :stop, :restart, :reload,
+ :mask, :unmask
def initialize(name, run_context = nil)
super
@service_name = name
@enabled = nil
@running = nil
+ @masked = nil
@parameters = nil
@pattern = service_name
@start_command = nil
@@ -140,6 +142,15 @@ class Chef
)
end
+ # if the service is masked or not
+ def masked(arg=nil)
+ set_or_return(
+ :masked,
+ arg,
+ :kind_of => [ TrueClass, FalseClass ]
+ )
+ end
+
# Priority arguments can have two forms:
#
# - a simple number, in which the default start runlevels get