Sha256: 6bab7cbdfeab1a96738668b06ec5388499939ffc3bc3e41025bda6948a56897e

Contents?: true

Size: 873 Bytes

Versions: 13

Compression:

Stored size: 873 Bytes

Contents

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

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

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

  use_inline_resources

  def whyrun_supported?
    true
  end

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

  action :run do
    machine.execute(action_handler, new_resource.command, :stream => new_resource.live_stream,
                                                          :timeout => new_resource.timeout)
  end

end
end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
chef-provisioning-2.7.1 lib/chef/provider/machine_execute.rb
chef-provisioning-2.7.0 lib/chef/provider/machine_execute.rb
chef-provisioning-2.6.0 lib/chef/provider/machine_execute.rb
chef-provisioning-2.5.0 lib/chef/provider/machine_execute.rb
chef-provisioning-2.4.0 lib/chef/provider/machine_execute.rb
chef-provisioning-2.3.2 lib/chef/provider/machine_execute.rb
chef-provisioning-2.3.1 lib/chef/provider/machine_execute.rb
chef-provisioning-2.3.0 lib/chef/provider/machine_execute.rb
chef-provisioning-2.2.1 lib/chef/provider/machine_execute.rb
chef-provisioning-2.2.0 lib/chef/provider/machine_execute.rb
chef-provisioning-2.1.1 lib/chef/provider/machine_execute.rb
chef-provisioning-2.1.0 lib/chef/provider/machine_execute.rb
chef-provisioning-2.0.2 lib/chef/provider/machine_execute.rb