Class: ChefInstance::Provider::Instance
- Inherits:
-
Chef::Provider
- Object
- Chef::Provider
- ChefInstance::Provider::Instance
- Defined in:
- lib/chef_instance/provider_instance.rb
Overview
Provides a Superclass Chef Provider to help with Factories.
Instance Method Summary collapse
-
#action_create ⇒ Object
Installs the
install_type
Creates theservice_type
. -
#action_destroy ⇒ Object
Destroy the
service_type
Uninstall theinstall_type
. -
#action_disable ⇒ Object
Disable the
service_type
. -
#action_enable ⇒ Object
Enable the
service_type
. -
#initialize(new_resource, run_context = nil) ⇒ Instance
constructor
Construct a new ChefInstance::Provider::Instance.
-
#load_current_resource ⇒ TrueClass
Determines the state of the resource currently.
- #whyrun_supported? ⇒ Boolean
Constructor Details
#initialize(new_resource, run_context = nil) ⇒ Instance
Construct a new ChefInstance::Provider::Instance.
10 11 12 13 14 15 |
# File 'lib/chef_instance/provider_instance.rb', line 10 def initialize(new_resource, run_context = nil) super @new_resource = new_resource @run_context = run_context @namespace = @new_resource.namespace end |
Instance Method Details
#action_create ⇒ Object
Installs the install_type
Creates the service_type
29 30 31 32 |
# File 'lib/chef_instance/provider_instance.rb', line 29 def action_create instance(@new_resource.install_type, :install) instance(@new_resource.service_type, :create) end |
#action_destroy ⇒ Object
Destroy the service_type
Uninstall the install_type
36 37 |
# File 'lib/chef_instance/provider_instance.rb', line 36 def action_destroy end |
#action_disable ⇒ Object
Disable the service_type
40 41 42 |
# File 'lib/chef_instance/provider_instance.rb', line 40 def action_disable instance(@new_resource.service_type, :disable) end |
#action_enable ⇒ Object
Enable the service_type
45 46 47 |
# File 'lib/chef_instance/provider_instance.rb', line 45 def action_enable instance(@new_resource.service_type, :enable) end |
#load_current_resource ⇒ TrueClass
Determines the state of the resource currently
24 25 |
# File 'lib/chef_instance/provider_instance.rb', line 24 def load_current_resource end |
#whyrun_supported? ⇒ Boolean
18 19 20 |
# File 'lib/chef_instance/provider_instance.rb', line 18 def whyrun_supported? false end |