Class: Chef::Provider::MachineExecute

Inherits:
LWRPBase
  • Object
show all
Includes:
ChefMetal::ProviderActionHandler
Defined in:
lib/chef/provider/machine_execute.rb

Instance Method Summary collapse

Methods included from ChefMetal::ProviderActionHandler

#debug_name, #open_stream, #perform_action, #performed_action, #should_perform_actions, #updated!

Instance Method Details

#machineObject



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/chef/provider/machine_execute.rb', line 15

def machine
  @machine ||= begin
    if new_resource.machine.kind_of?(ChefMetal::Machine)
      new_resource.machine
    else
      # TODO this is inefficient, can we cache or something?
      node = Cheffish::CheffishServerAPI.new(new_resource.chef_server).get("/nodes/#{new_resource.machine}")
      new_resource.provisioner.connect_to_machine(node)
    end
  end
end

#whyrun_supported?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/chef/provider/machine_execute.rb', line 11

def whyrun_supported?
  true
end