Class: Chef::Knife::StencilNode
- Inherits:
-
Object
- Object
- Chef::Knife::StencilNode
- Includes:
- StencilBase
- Defined in:
- lib/chef/knife/stencil_node.rb
Overview
A node (server/host)
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#create ⇒ Object
Create that node in the appropriate cloud.
-
#delete ⇒ Object
Remove that node from the appropriate cloud.
-
#initialize(name, config, options = {}) ⇒ StencilNode
constructor
A new instance of StencilNode.
Methods included from StencilBase
#build_plugin_klass, #explain, #invoked_as_stencil?, #locate_config_value, #normalize_path, #stencil_root
Constructor Details
#initialize(name, config, options = {}) ⇒ StencilNode
Returns a new instance of StencilNode.
30 31 32 33 34 |
# File 'lib/chef/knife/stencil_node.rb', line 30 def initialize(name, config, ={}) @name = name @config = config explain("Configuration #{config}") end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
28 29 30 |
# File 'lib/chef/knife/stencil_node.rb', line 28 def config @config end |
#name ⇒ Object
Returns the value of attribute name.
28 29 30 |
# File 'lib/chef/knife/stencil_node.rb', line 28 def name @name end |
Instance Method Details
#create ⇒ Object
Create that node in the appropriate cloud
37 38 39 40 41 |
# File 'lib/chef/knife/stencil_node.rb', line 37 def create klass = build_plugin_klass(config[:plugin], :server, :create) obj = klass.new obj.run end |
#delete ⇒ Object
Remove that node from the appropriate cloud
44 45 46 47 48 |
# File 'lib/chef/knife/stencil_node.rb', line 44 def delete klass = build_plugin_klass(config[:plugin], :server, :delete) obj = klass.new obj.run end |