Class: Chef::Provider::MachineFile

Inherits:
LWRPBase
  • Object
show all
Defined in:
lib/chef/provider/machine_file.rb

Instance Method Summary collapse

Instance Method Details

#machineObject



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/chef/provider/machine_file.rb', line 12

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)


8
9
10
# File 'lib/chef/provider/machine_file.rb', line 8

def whyrun_supported?
  true
end