Sha256: c0401a70dc36b464c37ad756f16569c7af5bc4bff6b6e211b5f854e085987a96
Contents?: true
Size: 835 Bytes
Versions: 37
Compression:
Stored size: 835 Bytes
Contents
# # Run an SSH script # module Chimp class ExecSSH < Executor attr_accessor :ssh_user def initialize(h={}) super(h) @ssh_user = h[:ssh_user] end def run host = @server.ip_address || nil @ssh_user ||= "root" run_with_retry do Log.debug "ssh #{@ssh_user}@#{host} \"#{@exec}\"" success = system("ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no #{@ssh_user}@#{host} \"#{@exec}\"") if not $?.success? raise "SSH failed with status: #{$?}" end end end def describe_work return "ExecSSH job_id=#{@job_id} command=\"#{@exec}\" server=\"#{@server.nickname}\"" end def info return @exec.to_s end def target return @server.nickname end end end
Version data entries
37 entries across 37 versions & 1 rubygems