vagrant-timezone 0.1.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0cb2f52c3d1916a0e4d2b2f8dfbdd10c894a7c1f
4
- data.tar.gz: 55a4334eeddab2f762c8f50d3db7fdf0af4ecf7e
3
+ metadata.gz: fabe1cb7c62e60b6864470c887ff40b229afc716
4
+ data.tar.gz: 10543277db6591d66099adb5a56dcda7d02ae4dc
5
5
  SHA512:
6
- metadata.gz: 73dc18f9adeb3721f188cc946349fe2cf84795d846592f890d6afaa86959170ea7665971e96fdcbafb2abcf0614ce83e83bd2248613dd0e404de5b419cd7beed
7
- data.tar.gz: 009b39f98fdfd27b22000edb82a8294c27da3f5b58e25bc992d3e4f34519b990b5a590d6c18417c0f23eb4426232bf8a2e322a61440bba5f0d614155e31a7dca
6
+ metadata.gz: f171a78592aed04ce0e530d9bd84f05fb810266849990a94f1ee71eb312a8490e57ac4413506b8c4df6ab6b7bd0c7880143f6a3c0a5d86be7a4ae63bef0613f5
7
+ data.tar.gz: 256d470f0a5752aef5b85c507d5b3b101feea1f858b9dc3f40a2faaaf85455143f7e996d23b4c9d1941aa436572718e2d6bb6c9f7ae3e311dbe416e88370f111
@@ -1,3 +1,11 @@
1
+ # 1.0.0 / 2014-10-27
2
+
3
+ Features:
4
+
5
+ - Support Arch, CoreOS, and Gentoo Linux
6
+ - Support FreeBSD, NetBSD, and OpenBSD
7
+ - Support OS X
8
+
1
9
  # 0.1.0 / 2014-10-26
2
10
 
3
11
  - Initial release
data/README.md CHANGED
@@ -29,10 +29,25 @@ Vagrant.configure("2") do |config|
29
29
  end
30
30
  ```
31
31
 
32
+ The value can be anything that the [tz database supports](http://en.wikipedia.org/wiki/List_of_tz_database_time_zones) (the "TZ" column). For example "UTC" or "Europe/Helsinki".
33
+
32
34
  ## Compatibility
33
35
 
34
36
  This plugin requires Vagrant 1.2 or newer ([downloads](https://www.vagrantup.com/downloads)).
35
37
 
36
38
  The plugin is supposed to be compatible with all Vagrant providers and other plugins. Please file an [issue](https://github.com/tmatilai/vagrant-timezone/issues) if this is not the case.
37
39
 
38
- At the moment only Debian and RedHat based VMs are supported.
40
+ At the moment the supported platforms include:
41
+
42
+ - Linux:
43
+ * Arch
44
+ * CoreOS
45
+ * Debian (and derivatives)
46
+ * Gentoo
47
+ * RedHat (and derivatives)
48
+
49
+ - BSD:
50
+ * FreeBSD
51
+ * NetBSD
52
+ * OpenBSD
53
+ * OS X
@@ -0,0 +1,13 @@
1
+ module VagrantPlugins
2
+ module TimeZone
3
+ module Cap
4
+ # Arch capabilities for changing time zone
5
+ class Arch
6
+ # Set the time zone
7
+ def self.change_timezone(machine, timezone)
8
+ machine.communicate.sudo("timedatectl set-timezone '#{timezone}'")
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module VagrantPlugins
2
+ module TimeZone
3
+ module Cap
4
+ # CoreOS capabilities for changing time zone
5
+ class CoreOS
6
+ # Set the time zone
7
+ def self.change_timezone(machine, timezone)
8
+ machine.communicate.sudo("timedatectl set-timezone '#{timezone}'")
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -2,7 +2,7 @@ module VagrantPlugins
2
2
  module TimeZone
3
3
  module Cap
4
4
  # Debian capabilities for changing time zone
5
- module Debian
5
+ class Debian
6
6
  # Set the time zone
7
7
  def self.change_timezone(machine, timezone)
8
8
  machine.communicate.tap do |comm|
@@ -0,0 +1,20 @@
1
+ module VagrantPlugins
2
+ module TimeZone
3
+ module Cap
4
+ # Gentoo capabilities for changing time zone
5
+ class Gentoo
6
+ # Set the time zone
7
+ def self.change_timezone(machine, timezone)
8
+ machine.communicate.tap do |comm|
9
+ if comm.test('which timedatectl', sudo: true)
10
+ comm.sudo("timedatectl set-timezone '#{timezone}'")
11
+ else
12
+ comm.sudo("echo '#{timezone}' > /etc/timezone")
13
+ comm.sudo('emerge --config timezone-data')
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -1,14 +1,16 @@
1
+ require_relative 'unix'
2
+
1
3
  module VagrantPlugins
2
4
  module TimeZone
3
5
  module Cap
4
6
  # RedHat capabilities for changing time zone
5
- module RedHat
7
+ class RedHat < Unix
6
8
  # Set the time zone
7
9
  def self.change_timezone(machine, timezone)
8
- machine.communicate.tap do |comm|
9
- comm.sudo("echo 'ZONE=\"#{timezone}\"' > /etc/sysconfig/clock")
10
- comm.sudo("ln -sf /usr/share/zoneinfo/#{timezone} /etc/localtime")
11
- end
10
+ super
11
+
12
+ machine.communicate.sudo(
13
+ "echo 'ZONE=\"#{timezone}\"' > /etc/sysconfig/clock")
12
14
  end
13
15
  end
14
16
  end
@@ -0,0 +1,16 @@
1
+ module VagrantPlugins
2
+ module TimeZone
3
+ module Cap
4
+ # Generic *nix capabilities for changing time zone
5
+ class Unix
6
+ # Set the time zone
7
+ def self.change_timezone(machine, timezone)
8
+ machine.communicate.sudo(
9
+ "ln -sf /usr/share/zoneinfo/#{timezone} /etc/localtime",
10
+ shell: 'sh'
11
+ )
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -59,11 +59,46 @@ module VagrantPlugins
59
59
  hook.after Vagrant::Action::Builtin::Provision, Action::SetTimeZone
60
60
  end
61
61
 
62
+ guest_capability 'arch', 'change_timezone' do
63
+ require_relative 'cap/arch'
64
+ Cap::Arch
65
+ end
66
+
67
+ guest_capability 'coreos', 'change_timezone' do
68
+ require_relative 'cap/coreos'
69
+ Cap::CoreOS
70
+ end
71
+
72
+ guest_capability 'darwin', 'change_timezone' do
73
+ require_relative 'cap/unix'
74
+ Cap::Unix
75
+ end
76
+
62
77
  guest_capability 'debian', 'change_timezone' do
63
78
  require_relative 'cap/debian'
64
79
  Cap::Debian
65
80
  end
66
81
 
82
+ guest_capability 'freebsd', 'change_timezone' do
83
+ require_relative 'cap/unix'
84
+ Cap::Unix
85
+ end
86
+
87
+ guest_capability 'gentoo', 'change_timezone' do
88
+ require_relative 'cap/gentoo'
89
+ Cap::Gentoo
90
+ end
91
+
92
+ guest_capability 'netbsd', 'change_timezone' do
93
+ require_relative 'cap/unix'
94
+ Cap::Unix
95
+ end
96
+
97
+ guest_capability 'openbsd', 'change_timezone' do
98
+ require_relative 'cap/unix'
99
+ Cap::Unix
100
+ end
101
+
67
102
  guest_capability 'redhat', 'change_timezone' do
68
103
  require_relative 'cap/redhat'
69
104
  Cap::RedHat
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module TimeZone
3
- VERSION = '0.1.0'
3
+ VERSION = '1.0.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-timezone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Teemu Matilainen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-26 00:00:00.000000000 Z
11
+ date: 2014-10-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A Vagrant plugin that configures the time zone of a virtual machine
14
14
  email:
@@ -26,8 +26,12 @@ files:
26
26
  - Rakefile
27
27
  - lib/vagrant-timezone.rb
28
28
  - lib/vagrant-timezone/action/set_timezone.rb
29
+ - lib/vagrant-timezone/cap/arch.rb
30
+ - lib/vagrant-timezone/cap/coreos.rb
29
31
  - lib/vagrant-timezone/cap/debian.rb
32
+ - lib/vagrant-timezone/cap/gentoo.rb
30
33
  - lib/vagrant-timezone/cap/redhat.rb
34
+ - lib/vagrant-timezone/cap/unix.rb
31
35
  - lib/vagrant-timezone/config.rb
32
36
  - lib/vagrant-timezone/logger.rb
33
37
  - lib/vagrant-timezone/plugin.rb