Rubber + Google cloud as generic provider

382 views Asked by At

I've setup and created (manually) instance at google cloud, added my ssh key (from id_rsa.pub) into it, so I can ssh [email protected] without any password, user set as sudoer.

I've setup 'generic' provider in rubber.yml:

generic: key_file: "#{Dir[(File.expand_path('~') rescue '/root') + '/.ssh/id_rsa.pub'].first}"

I've set in deploy.rb:

set :initial_ssh_user, 'username'

Now when i am trying to cap rubber:create_staging RAILS_ENV=staging, After few questions of role/ip its asking me for root password:

 ** Instance api-staging created: api-staging
Waiting for instances to start
 ** Instance running, fetching hostname/ip data
.Trying to enable root login
Password for username @ x.x.x.x: .
  * 2014-11-16 14:07:45 executing `rubber:_ensure_key_file_present'
  * 2014-11-16 14:07:45 executing `rubber:_allow_root_ssh'
  * executing "sudo -p 'sudo password: '  bash -l -c 'mkdir -p /root/.ssh && cp /home/username/.ssh/authorized_keys /root/.ssh/'"
    servers: ["x.x.x.x"]
 ** Can't connect as user cat.of.duty to x.x.x.x, assuming root allowed
  * 2014-11-16 14:07:46 executing `rubber:_direct_connection_x.x.x.x'
  * executing "echo"
    servers: ["x.x.x.x"]
.. ** Failed to connect to x.x.x.x, retrying

Over and over again

0

There are 0 answers