Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Net::SSH.start(ip, 'ubuntu', keys: "mykey.pem" ) do |ssh|
- ssh.exec "sudo chmod +x /tmp/provision.sh"
- end
- model Instance
- def chmod
- start do |ssh|
- ssh.exec "sudo chmod +x /tmp/provision.sh"
- # other operations on ssh
- end
- end
- private
- def start
- Net::SSH.start(ip, 'ubuntu', keys: "mykey.pem" ) do |ssh|
- yield ssh
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement