diff --git a/plugins/provisioners/shell/config.rb b/plugins/provisioners/shell/config.rb index 6c9e4d223..e5a855287 100644 --- a/plugins/provisioners/shell/config.rb +++ b/plugins/provisioners/shell/config.rb @@ -5,9 +5,11 @@ module VagrantPlugins attr_accessor :path attr_accessor :upload_path attr_accessor :args + attr_accessor :privileged def initialize @upload_path = "/tmp/vagrant-shell" + @privileged = true end def validate(machine) diff --git a/plugins/provisioners/shell/provisioner.rb b/plugins/provisioners/shell/provisioner.rb index 42cbdb3fa..dd2be8658 100644 --- a/plugins/provisioners/shell/provisioner.rb +++ b/plugins/provisioners/shell/provisioner.rb @@ -14,8 +14,7 @@ module VagrantPlugins @machine.communicate.tap do |comm| comm.upload(path.to_s, config.upload_path) - # Execute it with sudo - comm.sudo(command) do |type, data| + comm.execute(command, {:sudo => config.privileged}) do |type, data| if [:stderr, :stdout].include?(type) # Output the data with the proper color based on the stream. color = type == :stdout ? :green : :red