Class: VagrantPlugins::TimeZone::Cap::Debian

Inherits:
Linux
  • Object
show all
Defined in:
lib/vagrant-timezone/cap/debian.rb

Overview

Debian capabilities for changing time zone

Class Method Summary collapse

Methods inherited from Linux

change_timezone, change_timezone_timedatectl, timedatectl?

Class Method Details

.change_timezone_generic(machine, timezone) ⇒ Object

Set the time zone if ‘timedatectl` is not found



9
10
11
12
13
14
# File 'lib/vagrant-timezone/cap/debian.rb', line 9

def self.change_timezone_generic(machine, timezone)
  machine.communicate.tap do |comm|
    comm.sudo("echo '#{timezone}' > /etc/timezone")
    comm.sudo('dpkg-reconfigure --frontend noninteractive tzdata')
  end
end