Skip to content

Commit

Permalink
Provide late sudo install on DO's debian-8 image
Browse files Browse the repository at this point in the history
Various issues (as far as I can see devopsgroup-io#203 and devopsgroup-io#109) report a missing sudo on
DigitalOceans debian8 images. We're providing a late installation on vagrant up
which should fix these issues.
  • Loading branch information
hendrikb committed Jan 13, 2016
1 parent 5e57553 commit 34c815d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/vagrant-digitalocean/actions/setup_sudo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ def call(env)
guest_name ||= @machine.guest.to_s.downcase

case guest_name
when /debian/
if @machine.provider_config.image =~ /^debian-8/
@logger.info "DigitalOcean's debian-8 image lacks sudo. Installing now."
@machine.communicate.execute(<<-'BASH')
if [ ! -x /usr/bin/sudo ] ; then apt-get update -y && apt-get install -y sudo ; fi
BASH
end
when /redhat/
env[:ui].info I18n.t('vagrant_digital_ocean.info.modifying_sudo')

Expand Down

0 comments on commit 34c815d

Please sign in to comment.