Sha256: 4c181f3e34e62006780ce40e5a13f0552d3e038e4bc4b41d4ac7ba0032cea143
Contents?: true
Size: 815 Bytes
Versions: 19
Compression:
Stored size: 815 Bytes
Contents
module Fog module Compute class AWS class Server def setup(credentials = {}) requires :ssh_ip_address, :username commands = [ %{mkdir .ssh}, %{passwd -l #{username}}, %{echo "#{Fog::JSON.encode(Fog::JSON.sanitize(attributes))}" >> ~/attributes.json} ] if public_key commands << %{echo "#{public_key}" >> ~/.ssh/authorized_keys} end tries = 5 sleep_secs = 5 begin Nucleon::Util::SSH.session(ssh_ip_address, username, ssh_port, private_key_path, true) results = Nucleon::Util::SSH.exec(ssh_ip_address, username, commands) rescue Exception => error if tries > 1 sleep(sleep_secs) tries -= 1 retry else raise error end end end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems