Trying to check Capistrano from scratch.
Capfile:
require 'capistrano/setup'
require 'capistrano/deploy'
I18n.enforce_available_locales = false
Dir.glob('lib/capistrano/tasks/*.rb').each { |r| import r }
deploy.rb:
role :testrole, 'x.x.x.x'
set :user, 'ubuntu'
The test.rb task:
namespace :test do
desc "Uptime on servers"
task :uptime do
on roles(:testrole) do
execute "uptime"
end
end
end
cap command:
cap production test:uptime
exit:
INFO [c077da7f] Running /usr/bin/env uptime on x.x.x.x
DEBUG [c077da7f] Command: /usr/bin/env uptime
cap aborted!
Net::SSH::AuthenticationFailed
You have no problem logging in with the same user and key. Upon entering the remote server, I can see in auth.log that the empty user specified when the cap was executed:
test-srv sshd[1459]: Invalid user from x.x.x.x
What am I missing? Thanks!
source
share