Sha256: bf56d844b265bd90ba672e980b4ef74ad7c0238e886c53d3a430e3b615d72d7e

Contents?: true

Size: 686 Bytes

Versions: 33

Compression:

Stored size: 686 Bytes

Contents

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

class Chef::Provider::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

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
clc-fork-chef-metal-0.14.alpha.3 lib/chef/provider/machine_execute.rb
clc-fork-chef-metal-0.14.alpha.2 lib/chef/provider/machine_execute.rb
chef-metal-0.14.2 lib/chef/provider/machine_execute.rb
clc-fork-chef-metal-0.14.alpha.1 lib/chef/provider/machine_execute.rb
chef-metal-0.14.1 lib/chef/provider/machine_execute.rb
chef-metal-0.14 lib/chef/provider/machine_execute.rb
clc-fork-chef-metal-0.13.alpha.1 lib/chef/provider/machine_execute.rb
chef-metal-0.13 lib/chef/provider/machine_execute.rb
clc-fork-chef-metal-0.12.1.alpha.4 lib/chef/provider/machine_execute.rb
clc-fork-chef-metal-0.12.1.alpha.3 lib/chef/provider/machine_execute.rb
clc-fork-chef-metal-0.12.1.alpha.2 lib/chef/provider/machine_execute.rb
clc-fork-chef-metal-0.12.1.alpha.1 lib/chef/provider/machine_execute.rb
chef-metal-0.12.1 lib/chef/provider/machine_execute.rb
chef-metal-0.12 lib/chef/provider/machine_execute.rb
clc-fork-chef-metal-0.11.2.alpha.3 lib/chef/provider/machine_execute.rb
clc-fork-chef-metal-0.11.2.alpha.2 lib/chef/provider/machine_execute.rb
clc-fork-chef-metal-0.11.2.alpha.1 lib/chef/provider/machine_execute.rb
chef-metal-0.11.2 lib/chef/provider/machine_execute.rb
chef-metal-0.11.1 lib/chef/provider/machine_execute.rb
chef-metal-0.11 lib/chef/provider/machine_execute.rb