Class: Tinychef::NodeRun

Inherits:
Object
  • Object
show all
Defined in:
lib/tinychef/node_run.rb

Defined Under Namespace

Classes: OptionsError

Constant Summary collapse

RECIPES_DIR =
"recipes"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ NodeRun

Returns a new instance of NodeRun.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/tinychef/node_run.rb', line 26

def initialize(options)
  node     = options[:node]
  dest     = options[:dest]
  run_list = options[:run_list]

  @node = Tinychef::Node.new(node)
  @dest = Tinychef::Destination.new(dest || @node.host)

  @run_list = run_list

  prepare_run_list_command

rescue => e
  puts e.inspect
  raise OptionsError
end

Instance Attribute Details

#destObject (readonly)

Returns the value of attribute dest.



24
25
26
# File 'lib/tinychef/node_run.rb', line 24

def dest
  @dest
end

#nodeObject (readonly)

Returns the value of attribute node.



24
25
26
# File 'lib/tinychef/node_run.rb', line 24

def node
  @node
end

#run_listObject (readonly)

Returns the value of attribute run_list.



24
25
26
# File 'lib/tinychef/node_run.rb', line 24

def run_list
  @run_list
end

#run_list_commandObject (readonly)

Returns the value of attribute run_list_command.



24
25
26
# File 'lib/tinychef/node_run.rb', line 24

def run_list_command
  @run_list_command
end

Instance Method Details

#startObject



43
44
45
46
47
48
# File 'lib/tinychef/node_run.rb', line 43

def start
  sync_files
  ensure_remote_data_bag_file_exits
  run_code
  remove_files
end