vagrant-vbguest 0.25.0 → 0.26.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 +4 -4
- data/CHANGELOG.md +8 -1
- data/Readme.md +21 -0
- data/VERSION +1 -1
- data/lib/vagrant-vbguest/config.rb +6 -3
- data/lib/vagrant-vbguest/installer.rb +32 -6
- data/lib/vagrant-vbguest/installers/redhat.rb +17 -2
- data/locales/en.yml +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7a6d0a4fb842515ecb1dd74ecb969b916c9673aaefabad4f866e84a4fadcdd5
|
4
|
+
data.tar.gz: c799100151565c5bced4e1efdc1af7e833fb8e01b1ab6ec74ec94d01e7f05676
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14ae4c8c9751d61040c7658d487271a2fdcd7f55f734a1487921c15d05cc97f175aafafde2e1787cadd48c05259f4dcfde4aac3e810c0b1723dd228d3e41af8f
|
7
|
+
data.tar.gz: 5791807d0b50e929402798b41647306c1edb40e434b25c9264c633bb2c76f8c4b02e18012488a5ef136fee0616777c46daaee044fcdaca066241f8d9372f1a06
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,11 @@
|
|
1
|
-
## 0.
|
1
|
+
## 0.26.0 (2020-10-30)
|
2
|
+
|
3
|
+
- Add a new configuration `installer_hooks` allows to configure arbitrary scripts to be run on the guest before/after installer steps are executed.
|
4
|
+
- Fix RHEL8 perl vs. perl-interpreter [GH-368]
|
5
|
+
- On RedHad, use `dnf` instead of `yum` if available. [GH-368]
|
6
|
+
- Fix incorrect re-use of installer_* options.
|
7
|
+
|
8
|
+
## 0.25.0 (2020-09-26)
|
2
9
|
|
3
10
|
- Renames mainline branch from "master" to "main"
|
4
11
|
- Fix not detecting running GuestAdditions on some systems [GH-347], [GH-376]. Thanks @Morac2 for [GH-377]
|
data/Readme.md
CHANGED
@@ -59,6 +59,7 @@ vbguest will try to autodetect the best option for your system. WTF? see below.
|
|
59
59
|
* `installer` (`VagrantVbguest::Installers::Base`, optional) : Reference to a (custom) installer class
|
60
60
|
* `installer_arguments` (Array, default: `['--nox11']`) : List of additional arguments to pass to the installer. eg: `%w{--nox11 --force}` would execute `VBoxLinuxAdditions.run install --nox11 --force`
|
61
61
|
* `installer_options` (Hash, default: `{}`) : Configure how a Installer internally works. Should be set on a `vm` level.
|
62
|
+
* `installer_hooks` (Hash, default: `{}`) : Configure scripts to be run before/after installer steps.
|
62
63
|
* `yes` (Boolean or String, default: `true`): Wheter to pipe `yes` to the installer. If `true`, executes `yes | VBoxLinuxAdditions.run install`. With `false`, the command is executed without `yes`. You can also put in a string here for `yes` (e.g. `no` to refuse all messages)
|
63
64
|
|
64
65
|
|
@@ -128,6 +129,26 @@ VagrantVbguest::Config.auto_update = false
|
|
128
129
|
Settings in a project's `Vagrantfile` will overwrite those setting. When executed as a command, command line arguments will overwrite all of the above.
|
129
130
|
|
130
131
|
|
132
|
+
#### Installer Hooks (`installer_hooks`)
|
133
|
+
|
134
|
+
Additionally to the build-in `installer_options`, you can configure to execute scripts around the install steps `install`, `rebuild` and `start`.
|
135
|
+
Accepts either a single command or and array of commands. Box-specific settings overwrite earlier settings, just like with `installer_options`.
|
136
|
+
|
137
|
+
Use this make changes to the guest, for example to install specific dependencies or tweak the network setup.
|
138
|
+
|
139
|
+
* `before_install`/`after_install`: Runs before/after the install step. That is before uploading the iso file into the guest and after unmounting the iso file.
|
140
|
+
* `before_rebuild`/`after_rebuild`: Runs before/after the installer runs a command to let the GuestAdditions rebuild itself.
|
141
|
+
* `before_start`/`after_start`: Runs before/after the installer runs a command to start the GuestAdditions service.
|
142
|
+
|
143
|
+
```ruby
|
144
|
+
Vagrant.configure("2") do |config|
|
145
|
+
config.vm.define "my_cent_os_box" do |c|
|
146
|
+
c.vbguest.installer_hooks[:before_install] = ["yum install -y epel-release", "sleep 1"]
|
147
|
+
end
|
148
|
+
end
|
149
|
+
```
|
150
|
+
|
151
|
+
|
131
152
|
### Running as a middleware
|
132
153
|
|
133
154
|
Running as a middleware is the default way of using *vagrant-vbguest*.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.26.0
|
@@ -5,7 +5,7 @@ module VagrantVbguest
|
|
5
5
|
module Attributes
|
6
6
|
attr_accessor :auto_update, :auto_reboot, :no_install, :no_remote,
|
7
7
|
:installer, :installer_arguments, :installer_options,
|
8
|
-
:allow_downgrade,
|
8
|
+
:installer_hooks, :allow_downgrade,
|
9
9
|
:iso_path, :iso_upload_path, :iso_mount_point, :yes
|
10
10
|
end
|
11
11
|
|
@@ -18,6 +18,7 @@ module VagrantVbguest
|
|
18
18
|
def no_remote; @no_remote.nil? ? false : @no_remote end
|
19
19
|
def installer_arguments; @installer_arguments.nil? ? '--nox11' : @installer_arguments end
|
20
20
|
def installer_options; @installer_options ||= {} end
|
21
|
+
def installer_hooks; @installer_hooks ||= {} end
|
21
22
|
def yes; @yes.nil? ? true : @yes end
|
22
23
|
|
23
24
|
def iso_path
|
@@ -34,8 +35,9 @@ module VagrantVbguest
|
|
34
35
|
def auto_reboot; @auto_reboot.nil? ? self.class.auto_reboot : @auto_reboot end
|
35
36
|
def no_install; @no_install.nil? ? self.class.no_install : @no_install end
|
36
37
|
def no_remote; @no_remote.nil? ? self.class.no_remote : @no_remote end
|
37
|
-
def installer_arguments; @installer_arguments.nil? ? self.class.installer_arguments : @installer_arguments end
|
38
|
-
def installer_options; @installer_options ||= self.class.installer_options end
|
38
|
+
def installer_arguments; @installer_arguments.nil? ? self.class.installer_arguments.dup : @installer_arguments end
|
39
|
+
def installer_options; @installer_options ||= self.class.installer_options.dup end
|
40
|
+
def installer_hooks; @installer_hooks ||= self.class.installer_hooks.dup end
|
39
41
|
def yes; @yes.nil? ? self.class.yes : @yes end
|
40
42
|
|
41
43
|
def iso_path
|
@@ -51,6 +53,7 @@ module VagrantVbguest
|
|
51
53
|
:installer => installer,
|
52
54
|
:installer_arguments => installer_arguments,
|
53
55
|
:installer_options => installer_options,
|
56
|
+
:installer_hooks => installer_hooks,
|
54
57
|
:iso_path => iso_path,
|
55
58
|
:iso_upload_path => iso_upload_path,
|
56
59
|
:iso_mount_point => iso_mount_point,
|
@@ -60,8 +60,10 @@ module VagrantVbguest
|
|
60
60
|
installer = guest_installer
|
61
61
|
raise NoInstallerFoundError, :method => 'install' if !installer
|
62
62
|
|
63
|
-
|
64
|
-
|
63
|
+
with_hooks(:install) do
|
64
|
+
installer.install do |type, data|
|
65
|
+
@env.ui.info(data, :prefix => false, :new_line => false)
|
66
|
+
end
|
65
67
|
end
|
66
68
|
ensure
|
67
69
|
cleanup
|
@@ -71,8 +73,10 @@ module VagrantVbguest
|
|
71
73
|
installer = guest_installer
|
72
74
|
raise NoInstallerFoundError, :method => 'rebuild' if !installer
|
73
75
|
|
74
|
-
|
75
|
-
|
76
|
+
with_hooks(:rebuild) do
|
77
|
+
installer.rebuild do |type, data|
|
78
|
+
@env.ui.info(data, :prefix => false, :new_line => false)
|
79
|
+
end
|
76
80
|
end
|
77
81
|
end
|
78
82
|
|
@@ -80,8 +84,10 @@ module VagrantVbguest
|
|
80
84
|
installer = guest_installer
|
81
85
|
raise NoInstallerFoundError, :method => 'manual start' if !installer
|
82
86
|
|
83
|
-
|
84
|
-
|
87
|
+
with_hooks(:start) do
|
88
|
+
installer.start do |type, data|
|
89
|
+
@env.ui.info(data, :prefix => false, :new_line => false)
|
90
|
+
end
|
85
91
|
end
|
86
92
|
end
|
87
93
|
|
@@ -148,5 +154,25 @@ module VagrantVbguest
|
|
148
154
|
@guest_installer.cleanup if @guest_installer
|
149
155
|
end
|
150
156
|
|
157
|
+
def with_hooks(step_name)
|
158
|
+
run_hook(:"before_#{step_name}")
|
159
|
+
ret = yield
|
160
|
+
run_hook(:"after_#{step_name}")
|
161
|
+
|
162
|
+
ret
|
163
|
+
end
|
164
|
+
|
165
|
+
def run_hook(hook_name)
|
166
|
+
hooks = @options.dig(:installer_hooks, hook_name)
|
167
|
+
|
168
|
+
return if !hooks || hooks.empty?
|
169
|
+
|
170
|
+
@vm.ui.info I18n.t("vagrant_vbguest.installer_hooks.#{hook_name}")
|
171
|
+
Array(hooks).each do |l|
|
172
|
+
@vm.communicate.sudo(l) do |type, data|
|
173
|
+
@env.ui.info(data, :prefix => false, :new_line => false)
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
151
177
|
end
|
152
178
|
end
|
@@ -16,7 +16,11 @@ module VagrantVbguest
|
|
16
16
|
|
17
17
|
protected
|
18
18
|
def install_dependencies_cmd
|
19
|
-
"
|
19
|
+
"#{package_manager_cmd} install -y #{dependencies}"
|
20
|
+
end
|
21
|
+
|
22
|
+
def package_manager_cmd
|
23
|
+
"`bash -c 'type -p dnf || type -p yum'`"
|
20
24
|
end
|
21
25
|
|
22
26
|
def dependencies
|
@@ -26,11 +30,22 @@ module VagrantVbguest
|
|
26
30
|
'gcc',
|
27
31
|
'binutils',
|
28
32
|
'make',
|
29
|
-
|
33
|
+
perl_dependency,
|
30
34
|
'bzip2',
|
31
35
|
'elfutils-libelf-devel'
|
32
36
|
].join(' ')
|
33
37
|
end
|
38
|
+
|
39
|
+
def perl_dependency
|
40
|
+
unless instance_variable_defined?(:@perl_dependency)
|
41
|
+
@perl_dependency = if communicate.test("#{package_manager_cmd} list perl-interpreter")
|
42
|
+
"perl-interpreter"
|
43
|
+
else
|
44
|
+
"perl"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
@perl_dependency
|
48
|
+
end
|
34
49
|
end
|
35
50
|
end
|
36
51
|
end
|
data/locales/en.yml
CHANGED
@@ -34,6 +34,14 @@ en:
|
|
34
34
|
ok: "[%{vm_name}] GuestAdditions %{guest_version} running --- OK."
|
35
35
|
skipped_downgrade: "GuestAdditions are newer than your host but, downgrades are disabled. Skipping."
|
36
36
|
|
37
|
+
installer_hooks:
|
38
|
+
before_install: "Executing pre-install hooks"
|
39
|
+
after_install: "Executing post-install hooks"
|
40
|
+
before_rebuild: "Executing pre-rebuild hooks"
|
41
|
+
after_rebuild: "Executing post-rebuild hooks"
|
42
|
+
before_start: "Executing pre-start hooks"
|
43
|
+
after_start: "Executing post-start hooks"
|
44
|
+
|
37
45
|
errors:
|
38
46
|
autodetect_iso_path: |-
|
39
47
|
Could not locate a local Virtualbox Guest Additions iso file.
|
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.26.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Schulze
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: micromachine
|