sudo fails because the password prompt doesn't work
pedrocr opened this issue · 2 comments
pedrocr commented
I've just started to try supply_drop to replace the traditional puppetmaster setup I am using. I did a minimal test and couldn't get it to work because the sudo password prompt doesn't get passed on to my terminal. Here's the output of a cap run:
$ cap puppet:unlock
* 2013-05-13 22:23:52 executing `puppet:unlock'
* executing "sudo -p 'sudo password: ' rm -f /tmp/puppet.lock; true"
servers: ["golias.fernandocabral"]
[golias.fernandocabral] executing command
*** [err :: golias.fernandocabral] sudo: no tty present and no askpass program specified
*** [err :: golias.fernandocabral] Sorry, try again.
*** [err :: golias.fernandocabral] Sorry, try again.
*** [err :: golias.fernandocabral] sudo: no tty present and no askpass program specified
*** [err :: golias.fernandocabral] Sorry, try again.
*** [err :: golias.fernandocabral] sudo: no tty present and no askpass program specified
*** [err :: golias.fernandocabral] Sorry, try again.
*** [err :: golias.fernandocabral] sudo: no tty present and no askpass program specified
*** [err :: golias.fernandocabral] Sorry, try again.
*** [err :: golias.fernandocabral] Sorry, try again.
*** [err :: golias.fernandocabral] sudo: 3 incorrect password attempts
command finished in 796ms
My Capfile is minimal:
require 'rubygems'
require 'supply_drop'
ssh_options[:paranoid] = false
server "golias.fernandocabral", :general
Both my machine and the server I was pushing to are Ubuntu 12.04 LTS installs. Capistrano is version 2.15.4 and supply_drop is version 0.15.0
phinze commented
Try adding this line to your Capfile
default_run_options[:pty] = true
pedrocr commented
Yep, that solves it. None of the examples have that line. I see that it's a capistrano option so I guess supply_drop can't do anything about it. Thanks for the quick reply.