ssh commands file

This commit is contained in:
amartynov 2014-05-23 17:59:06 +04:00
parent 24dd007f2c
commit 90d0630ca2

View File

@ -0,0 +1,14 @@
module SshCommands
def ssh_test server, params
res, code = ssh_execute(server, "test #{params}")
code == 0
end
def ssh_execute server, cmd
key_path = File.join(DevopsCid.config[:keys_dir], server[:private_key])
res = `ssh -i #{key_path} #{server[:remote_user]}@#{server[:host]} '#{cmd}'`
return res, $?
end
end