vagrant-timezone 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +16 -1
- data/lib/vagrant-timezone/cap/arch.rb +13 -0
- data/lib/vagrant-timezone/cap/coreos.rb +13 -0
- data/lib/vagrant-timezone/cap/debian.rb +1 -1
- data/lib/vagrant-timezone/cap/gentoo.rb +20 -0
- data/lib/vagrant-timezone/cap/redhat.rb +7 -5
- data/lib/vagrant-timezone/cap/unix.rb +16 -0
- data/lib/vagrant-timezone/plugin.rb +35 -0
- data/lib/vagrant-timezone/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fabe1cb7c62e60b6864470c887ff40b229afc716
|
4
|
+
data.tar.gz: 10543277db6591d66099adb5a56dcda7d02ae4dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f171a78592aed04ce0e530d9bd84f05fb810266849990a94f1ee71eb312a8490e57ac4413506b8c4df6ab6b7bd0c7880143f6a3c0a5d86be7a4ae63bef0613f5
|
7
|
+
data.tar.gz: 256d470f0a5752aef5b85c507d5b3b101feea1f858b9dc3f40a2faaaf85455143f7e996d23b4c9d1941aa436572718e2d6bb6c9f7ae3e311dbe416e88370f111
|
data/CHANGELOG.md
CHANGED
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
|
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
|
@@ -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
|
-
|
7
|
+
class RedHat < Unix
|
6
8
|
# Set the time zone
|
7
9
|
def self.change_timezone(machine, timezone)
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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
|
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:
|
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-
|
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
|