Class: VagrantPlugins::TimeZone::Cap::Unix

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

Overview

Generic *nix capabilities for changing time zone

Class Method Summary collapse

Class Method Details

.change_timezone(machine, timezone) ⇒ Object

Set the time zone



7
8
9
10
11
12
# File 'lib/vagrant-timezone/cap/unix.rb', line 7

def self.change_timezone(machine, timezone)
  machine.communicate.sudo(
    "ln -sf /usr/share/zoneinfo/#{timezone} /etc/localtime",
    shell: 'sh'
  )
end