supply_drop icon indicating copy to clipboard operation
supply_drop copied to clipboard

puppet:bootstrap:puppetlabs:ubuntu is confused about sudo

Open chrchr opened this issue 9 years ago • 3 comments

rchurch$ bundle exec cap --trace vm puppet:bootstrap:puppetlabs:ubuntu
** Invoke vm (first_time)
** Execute vm
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke puppet:bootstrap:puppetlabs:ubuntu (first_time)
** Execute puppet:bootstrap:puppetlabs:ubuntu
INFO [cf8dd8ab] Running /usr/bin/env sudo as [email protected]
DEBUG [cf8dd8ab] Command: /usr/bin/env sudo
DEBUG [cf8dd8ab]    usage: sudo -h | -K | -k | -V
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]    usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]    usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]    [command]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]    usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]    prompt] [-u user] [VAR=value] [-i|-s] [<command>]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]    usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]
DEBUG [cf8dd8ab]    prompt] [-u user] file ...
DEBUG [cf8dd8ab]
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: sudo exit status: 1
sudo stdout: Nothing written
sudo stderr: usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
            [command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
            prompt] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
            prompt] [-u user] file ...
/Users/rchurch/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:16:in `rescue in block (2 levels) in execute'
/Users/rchurch/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
SSHKit::Command::Failed: sudo exit status: 1
sudo stdout: Nothing written
sudo stderr: usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
            [command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
            prompt] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
            prompt] [-u user] file ...
/Users/rchurch/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/sshkit-1.7.1/lib/sshkit/command.rb:95:in `exit_status='
/Users/rchurch/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:179:in `block in _execute'
/Users/rchurch/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:133:in `tap'
/Users/rchurch/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:133:in `_execute'
/Users/rchurch/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:66:in `execute'
/Users/rchurch/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/capistrano-3.4.0/lib/capistrano/dsl.rb:28:in `sudo'
/Users/rchurch/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/supply_drop-1.0.0.beta2/lib/supply_drop/tasks.rb:52:in `block (5 levels) in <top (required)>'
/Users/rchurch/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/Users/rchurch/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in `run'
/Users/rchurch/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
Tasks: TOP => puppet:bootstrap:puppetlabs:ubuntu

chrchr avatar Mar 18 '15 03:03 chrchr

You're not giving me a lot to go on here. Supply drop version? ubuntu version? Capistrano version? can you sudo other stuff in the VM?

As a workaround you can always just apt-get install puppet in the VM. These bootstrap methods are really just for convenience and not required.

pitluga avatar Mar 18 '15 16:03 pitluga

Sorry. Here's all the info:

'supply_drop', '~>1.0.0beta1' Ubuntu 14.04 Capistrano Version: 3.4.0 (Rake Version: 10.4.2)

cap vm puppet:bootstrap:ubuntu works fine. It's not a problem with sudo generally, but it looks to me like something not great happens here with the sudo on the right side of the pipe:

execute :echo, :deb, "http://apt.puppetlabs.com/ $(lsb_release -sc) main | #{sudo} tee /etc/apt/sources.list.d/puppet.list"

chrchr avatar Mar 18 '15 17:03 chrchr

@chrchr Looks like this is the same issue as #53

prachetasp avatar May 07 '15 07:05 prachetasp