Sha256: 9700dc5831b64a8f5f3c44144e0ba3e64a90a12f83e93d5e1e179882b02f6835

Contents?: true

Size: 705 Bytes

Versions: 7

Compression:

Stored size: 705 Bytes

Contents

require 'chef/provider/lwrp_base'
require 'chef_metal/chef_provider_action_handler'
require 'chef_metal/machine'

class Chef
class Provider
class MachineExecute < Chef::Provider::LWRPBase

  def action_handler
    @action_handler ||= ChefMetal::ChefProviderActionHandler.new(self)
  end

  use_inline_resources

  def whyrun_supported?
    true
  end

  def machine
    @machine ||= begin
      if new_resource.machine.kind_of?(ChefMetal::Machine)
        new_resource.machine
      else
        run_context.chef_metal.connect_to_machine(new_resource.machine, new_resource.chef_server)
      end
    end
  end

  action :run do
    machine.execute(action_handler, new_resource.command)
  end

end
end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
clc-fork-chef-metal-0.14.alpha.10 lib/chef/provider/machine_execute.rb
clc-fork-chef-metal-0.14.alpha.9 lib/chef/provider/machine_execute.rb
clc-fork-chef-metal-0.14.alpha.8 lib/chef/provider/machine_execute.rb
clc-fork-chef-metal-0.14.alpha.7 lib/chef/provider/machine_execute.rb
clc-fork-chef-metal-0.14.alpha.6 lib/chef/provider/machine_execute.rb
clc-fork-chef-metal-0.14.alpha.5 lib/chef/provider/machine_execute.rb
clc-fork-chef-metal-0.14.alpha.4 lib/chef/provider/machine_execute.rb