Hi, sending again with stubbed generate key method in tests. first patch makes event model more general (it's possible to associate events with any model, not only instance). Second patch adds support for generating unique ssh key for instance when it's started and uploads new key to server.
Gems delayed_job and net_scp are required. After installing delayed_job, start worker with: rake jobs:work