vagrant-vbguest 0.13.0 → 0.14.0.pre.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/Readme.md +6 -0
- data/lib/vagrant-vbguest/installers/base.rb +15 -1
- data/lib/vagrant-vbguest/installers/debian.rb +7 -2
- data/lib/vagrant-vbguest/installers/linux.rb +22 -26
- data/lib/vagrant-vbguest/vagrant_compat/vagrant_1_1/command.rb +5 -0
- data/lib/vagrant-vbguest/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 935cbab1bfa4e2bd7f6f5b303f3e2ffab882d2e3
|
4
|
+
data.tar.gz: f950bd3b43ca7df20a1be89f36b09b2e5a5b2056
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1ac88bee5274010f40affce9eb364439dabeee1307208895b91532ad7f97e438c6ae2bc52306906262ac60d3c6eab17e78d67930be0b2b1a2dfef931b3fdb6b
|
7
|
+
data.tar.gz: 04fd62c2c2ee0a304bde68e561e088fedf50470c957b3ee16e93af2cf6d0db80b19dd3d1b3b7fb4b5aef8030dcf8a5213f826c8aa6efd44fc57ab5236c699a19
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
## 0.14.0-beta1 (2017-02-24)
|
2
|
+
|
3
|
+
- Added support for VirtualBox 5.1. Thanks @cdloh [GH-238], [GH-230]
|
4
|
+
+ Waring: The helper method `vboxadd_tool` was replaced by `find_tool(tool)`
|
5
|
+
- The installers `distro(vm)` helper method got moved from the `Linux` class down the `Base` class which should make implementing non-linux installers easier. This change was purposed by @fabriciocolombo back in [GH-129]
|
6
|
+
- The debian installer added support for proxmox VE. Thanks @maninga [GH-246]
|
7
|
+
- The debian installer now calls `apt-get update` with `-y --force-yes` options. Thanks @podarok [GH-237]
|
8
|
+
- Add synopsis for help/list-commands. Thanks @m03 [GH-235], [GH-236]
|
9
|
+
- Fix typo in the `Installers::Base#yield_installation_warning` method name (keeping the incorrect `yield_installation_waring` as an alias for backward compatibility. This alias will be removed in a future version) Thanks @m03 [GH-234]
|
10
|
+
|
1
11
|
## 0.13.0 (2016-08-12)
|
2
12
|
|
3
13
|
- Fix a bug introduced by upgrading "micormachine". Thanks @omenlabs for [GH-225]
|
data/Readme.md
CHANGED
@@ -270,6 +270,12 @@ end
|
|
270
270
|
```
|
271
271
|
|
272
272
|
|
273
|
+
### Extending vbguest (aka Very Advanced Usage)
|
274
|
+
|
275
|
+
If you find yourself copying the same installer in each of your vagrant project, it might be a good idea to make it a plugin itself. Like vagrant-vbguest itself, installers can be [distributed as ruby gems](http://guides.rubygems.org/publishing/)
|
276
|
+
|
277
|
+
This poroject contains a [sample installer gem](https://github.com/dotless-de/vagrant-vbguest/tree/master/testdrive/vagrant-vbguest-unikorn) which might serve as an boilerplate.
|
278
|
+
|
273
279
|
## Known Issues
|
274
280
|
|
275
281
|
* The installer script, which mounts and runs the GuestAdditions Installer Binary, works on Linux only. Most likely it will run on most Unix-like platforms.
|
@@ -25,6 +25,18 @@ module VagrantVbguest
|
|
25
25
|
false
|
26
26
|
end
|
27
27
|
|
28
|
+
# A helper method to cache the result of {Vagrant::Guest::Base#distro_dispatch}
|
29
|
+
# which speeds up Installer detection runs a lot,
|
30
|
+
# when having lots of Linux based Installer classes
|
31
|
+
# to check.
|
32
|
+
#
|
33
|
+
# @see {Vagrant::Guest::Linux#distro_dispatch}
|
34
|
+
# @return [Symbol] One of `:debian`, `:ubuntu`, `:gentoo`, `:fedora`, `:redhat`, `:suse`, `:arch`, `:windows`
|
35
|
+
def self.distro(vm)
|
36
|
+
@@distro ||= {}
|
37
|
+
@@distro[ vm_id(vm) ] ||= distro_name vm
|
38
|
+
end
|
39
|
+
|
28
40
|
attr_reader :env, :vm, :options, :host
|
29
41
|
|
30
42
|
def initialize(vm, options=nil)
|
@@ -143,7 +155,7 @@ module VagrantVbguest
|
|
143
155
|
# Helper to yield a warning message to the user, that the installation
|
144
156
|
# will start _now_.
|
145
157
|
# The message includes the host and installer version strings.
|
146
|
-
def
|
158
|
+
def yield_installation_warning(path_to_installer)
|
147
159
|
@env.ui.warn I18n.t("vagrant_vbguest.installing#{@options[:force] ? '_forced' : ''}",
|
148
160
|
:guest_version => (guest_version || I18n.t("vagrant_vbguest.unknown")),
|
149
161
|
:installer_version => installer_version(path_to_installer) || I18n.t("vagrant_vbguest.unknown"))
|
@@ -168,6 +180,8 @@ module VagrantVbguest
|
|
168
180
|
@env.ui.warn I18n.t("vagrant_vbguest.install_error",
|
169
181
|
:installer_version => installer_version(path_to_installer) || I18n.t("vagrant_vbguest.unknown"))
|
170
182
|
end
|
183
|
+
# alias to old method name (containing a typo) for backwards compatibility
|
184
|
+
alias_method :yield_installation_waring, :yield_installation_error_warning
|
171
185
|
|
172
186
|
def iso_file
|
173
187
|
@host.additions_file
|
@@ -16,7 +16,7 @@ module VagrantVbguest
|
|
16
16
|
begin
|
17
17
|
communicate.sudo(install_dependencies_cmd, opts, &block)
|
18
18
|
rescue
|
19
|
-
communicate.sudo('apt-get update', opts, &block)
|
19
|
+
communicate.sudo('apt-get -y --force-yes update', opts.merge(:error_check => false), &block)
|
20
20
|
communicate.sudo(install_dependencies_cmd, opts, &block)
|
21
21
|
end
|
22
22
|
super
|
@@ -28,7 +28,12 @@ module VagrantVbguest
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def dependencies
|
31
|
-
|
31
|
+
# In case of PVE kernel, kernel modules and headers prefix is pve and not linux, so we need to check that.
|
32
|
+
packages = if communicate.test('uname -r | grep pve')
|
33
|
+
['pve-headers-`uname -r`']
|
34
|
+
else
|
35
|
+
['linux-headers-`uname -r`']
|
36
|
+
end
|
32
37
|
# some Debian system (lenny) don't come with a dkms package so we need to skip that.
|
33
38
|
# apt-cache search will exit with 0 even if nothing was found, so we need to grep.
|
34
39
|
packages << 'dkms' if communicate.test('apt-cache search --names-only \'^dkms$\' | grep dkms')
|
@@ -3,19 +3,6 @@ module VagrantVbguest
|
|
3
3
|
# A basic Installer implementation for vanilla or
|
4
4
|
# unknown Linux based systems.
|
5
5
|
class Linux < Base
|
6
|
-
|
7
|
-
# A helper method to cache the result of {Vagrant::Guest::Base#distro_dispatch}
|
8
|
-
# which speeds up Installer detection runs a lot,
|
9
|
-
# when having lots of Linux based Installer classes
|
10
|
-
# to check.
|
11
|
-
#
|
12
|
-
# @see {Vagrant::Guest::Linux#distro_dispatch}
|
13
|
-
# @return [Symbol] One of `:debian`, `:ubuntu`, `:gentoo`, `:fedora`, `:redhat`, `:suse`, `:arch`
|
14
|
-
def self.distro(vm)
|
15
|
-
@@distro ||= {}
|
16
|
-
@@distro[ vm_id(vm) ] ||= distro_name vm
|
17
|
-
end
|
18
|
-
|
19
6
|
# Matches if the operating system name prints "Linux"
|
20
7
|
# Raises an Error if this class is beeing subclassed but
|
21
8
|
# this method was not overridden. This is considered an
|
@@ -77,6 +64,7 @@ module VagrantVbguest
|
|
77
64
|
upload(iso_file)
|
78
65
|
mount_iso(opts, &block)
|
79
66
|
execute_installer(opts, &block)
|
67
|
+
start(opts, &block)
|
80
68
|
unmount_iso(opts, &block) unless options[:no_cleanup]
|
81
69
|
end
|
82
70
|
|
@@ -121,7 +109,7 @@ module VagrantVbguest
|
|
121
109
|
# @yieldparam [String] type Type of the output, `:stdout`, `:stderr`, etc.
|
122
110
|
# @yieldparam [String] data Data for the given output.
|
123
111
|
def rebuild(opts=nil, &block)
|
124
|
-
communicate.sudo("#{
|
112
|
+
communicate.sudo("#{find_tool('vboxadd')} setup", opts, &block)
|
125
113
|
end
|
126
114
|
|
127
115
|
# @param opts [Hash] Optional options Hash wich meight get passed to {Vagrant::Communication::SSH#execute} and firends
|
@@ -133,7 +121,15 @@ module VagrantVbguest
|
|
133
121
|
if systemd_tool
|
134
122
|
communicate.sudo("#{systemd_tool[:path]} vboxadd #{systemd_tool[:up]}", opts, &block)
|
135
123
|
else
|
136
|
-
communicate.sudo("#{
|
124
|
+
communicate.sudo("#{find_tool('vboxadd')} start", opts, &block)
|
125
|
+
end
|
126
|
+
|
127
|
+
if Gem::Version.new("#{guest_version}") >= Gem::Version.new('5.1')
|
128
|
+
if systemd_tool
|
129
|
+
communicate.sudo("#{systemd_tool[:path]} vboxadd-service #{systemd_tool[:up]}", opts, &block)
|
130
|
+
else
|
131
|
+
communicate.sudo("#{find_tool('vboxadd-service')} start", opts, &block)
|
132
|
+
end
|
137
133
|
end
|
138
134
|
end
|
139
135
|
|
@@ -166,21 +162,21 @@ module VagrantVbguest
|
|
166
162
|
end
|
167
163
|
end
|
168
164
|
|
169
|
-
# Checks for the correct location of the
|
165
|
+
# Checks for the correct location of the tool provided.
|
170
166
|
# It checks for a given list of possible locations. This list got
|
171
167
|
# extracted from the 'VBoxLinuxAdditions.run' script.
|
172
168
|
#
|
173
|
-
# @return [String|nil] Absolute path to the
|
169
|
+
# @return [String|nil] Absolute path to the tool,
|
174
170
|
# or +nil+ if none found.
|
175
|
-
def
|
171
|
+
def find_tool(tool)
|
176
172
|
candidates = [
|
177
|
-
"/usr/lib/i386-linux-gnu/VBoxGuestAdditions
|
178
|
-
"/usr/lib/x86_64-linux-gnu/VBoxGuestAdditions
|
179
|
-
"/usr/lib64/VBoxGuestAdditions
|
180
|
-
"/usr/lib/VBoxGuestAdditions
|
181
|
-
"/lib64/VBoxGuestAdditions
|
182
|
-
"/lib/VBoxGuestAdditions
|
183
|
-
"/etc/init.d
|
173
|
+
"/usr/lib/i386-linux-gnu/VBoxGuestAdditions/#{tool}",
|
174
|
+
"/usr/lib/x86_64-linux-gnu/VBoxGuestAdditions/#{tool}",
|
175
|
+
"/usr/lib64/VBoxGuestAdditions/#{tool}",
|
176
|
+
"/usr/lib/VBoxGuestAdditions/#{tool}",
|
177
|
+
"/lib64/VBoxGuestAdditions/#{tool}",
|
178
|
+
"/lib/VBoxGuestAdditions/#{tool}",
|
179
|
+
"/etc/init.d/#{tool}",
|
184
180
|
]
|
185
181
|
cmd = <<-SHELL
|
186
182
|
for c in #{candidates.join(" ")}; do
|
@@ -207,7 +203,7 @@ module VagrantVbguest
|
|
207
203
|
# @yieldparam [String] type Type of the output, `:stdout`, `:stderr`, etc.
|
208
204
|
# @yieldparam [String] data Data for the given output.
|
209
205
|
def execute_installer(opts=nil, &block)
|
210
|
-
|
206
|
+
yield_installation_warning(installer)
|
211
207
|
opts = {:error_check => false}.merge(opts || {})
|
212
208
|
exit_status = communicate.sudo("#{installer} #{installer_arguments}", opts, &block)
|
213
209
|
yield_installation_error_warning(installer) unless exit_status == 0
|
@@ -7,6 +7,11 @@ module VagrantVbguest
|
|
7
7
|
include CommandCommons
|
8
8
|
include VagrantPlugins::CommandUp::StartMixins
|
9
9
|
|
10
|
+
# Show description when `vagrant list-commands` is triggered
|
11
|
+
def self.synopsis
|
12
|
+
"plugin: vagrant-vbguest: install VirtualBox Guest Additions to the machine"
|
13
|
+
end
|
14
|
+
|
10
15
|
def check_runable_on(vm)
|
11
16
|
raise Vagrant::Errors::VMNotCreatedError if vm.state.id == :not_created
|
12
17
|
raise Vagrant::Errors::VMInaccessible if vm.state.id == :inaccessible
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-vbguest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.0.pre.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Schulze
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: micromachine
|
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
131
|
version: 1.3.6
|
132
132
|
requirements: []
|
133
133
|
rubyforge_project:
|
134
|
-
rubygems_version: 2.
|
134
|
+
rubygems_version: 2.5.2
|
135
135
|
signing_key:
|
136
136
|
specification_version: 4
|
137
137
|
summary: A Vagrant plugin to install the VirtualBoxAdditions into the guest VM
|