Class: Cap::DisableRequireTty

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-arubacloud/cap/disable_requiretty.rb

Class Method Summary collapse

Class Method Details

.disable_requiretty(machine) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/vagrant-arubacloud/cap/disable_requiretty.rb', line 3

def self.disable_requiretty(machine)
  output = ''
  command = 'sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers'

  machine.communicate.execute(command) do |type, data|
    output += data if type == :stdout
  end
  output.chomp!
end