Class: ChefMetal::ConvergenceStrategy::NoConverge

Inherits:
ChefMetal::ConvergenceStrategy show all
Defined in:
lib/chef_metal/convergence_strategy/no_converge.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#client_pem_pathObject (readonly)

Returns the value of attribute client_pem_path.



9
10
11
# File 'lib/chef_metal/convergence_strategy/no_converge.rb', line 9

def client_pem_path
  @client_pem_path
end

#client_rb_pathObject (readonly)

Returns the value of attribute client_rb_path.



8
9
10
# File 'lib/chef_metal/convergence_strategy/no_converge.rb', line 8

def client_rb_path
  @client_rb_path
end

Instance Method Details

#cleanup_convergence(action_handler, node) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/chef_metal/convergence_strategy/no_converge.rb', line 25

def cleanup_convergence(action_handler, node)
  ChefMetal.inline_resource(action_handler) do
    chef_node node['name'] do
      action :delete
    end
  end
end

#converge(action_handler, machine) ⇒ Object



22
23
# File 'lib/chef_metal/convergence_strategy/no_converge.rb', line 22

def converge(action_handler, machine)
end

#setup_convergence(action_handler, machine, machine_resource) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/chef_metal/convergence_strategy/no_converge.rb', line 11

def setup_convergence(action_handler, machine, machine_resource)
  # Save the node
  ChefMetal.inline_resource(action_handler) do
    # TODO strip automatic attributes first so we don't race with "current state"
    chef_node machine.node['name'] do
      chef_server machine_resource.chef_server
      raw_json machine.node
    end
  end
end