vagrant-vbguest 0.23.0 → 0.27.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de7e56db32055d21a641c0fff261a9dbff9f7faf6d1857b5eb5da239b7cbe0d6
4
- data.tar.gz: 332c697c6db4673e288874aeaf61ecd65233256a40635ea81216019f4269396a
3
+ metadata.gz: 1fecae71af01b753dc6ad5a6dd65a70dc4e4c39dbdaaeb5205c9bb88542e1efd
4
+ data.tar.gz: dfc9860b431a6bea6371aa5e4f51fcd30c6ec7ff74b96d4d09bbea1327ba1deb
5
5
  SHA512:
6
- metadata.gz: f1041e643b17bce30c935e3c753dcb05c54b90e51edfd2de1844ccba5656d721837a9b0d7955d99dfd271810f2cb36355d03bed21714e52e43c8cf7161ec5174
7
- data.tar.gz: b7a8fba5885fbca588c44dcf112eeacdd7b92604cb33378e1f59e75ab60bdfdab6c0d037a8cf725214eb3c01e3ea5c5a5b56d1f0f9e4ec149abad46f7a849fea
6
+ metadata.gz: 105dcfe234ee744cee3d5f21797e8bf43fa835c148c6816aff92805a996cf1074afece27b99b5f25e4d41a61e0f4a4cfaaa6c1e99b49f30a901eb6e233a4d0ad
7
+ data.tar.gz: 8f5684c37b0b59bd5d2465ab74d21ccf0169f3756a102e70c5066f5cc62ccb65f06a231b8e6d78a0b1caadec2e85c2990b67d7a78c7f25a4c2b8b631d6acaf46
@@ -0,0 +1,13 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "bundler" # See documentation for possible values
9
+ directory: "/" # Location of package manifests
10
+ schedule:
11
+ interval: "daily"
12
+ ignore:
13
+ - dependency-name: "vagrant"
@@ -1,3 +1,34 @@
1
+ ## 0.27.0 (2020-11-15)
2
+
3
+ - Un-mounting the guest additions iso will now take place in the cleanup step [GH-393]
4
+ - Running detection now checks for vboxguest and vboxsf kernel module. [GH-392], Fixes [GH-387]
5
+
6
+ ## 0.26.0 (2020-10-30)
7
+
8
+ - Add a new configuration `installer_hooks` allows to configure arbitrary scripts to be run on the guest before/after installer steps are executed.
9
+ - Fix RHEL8 perl vs. perl-interpreter [GH-368]
10
+ - On RedHad, use `dnf` instead of `yum` if available. [GH-368]
11
+ - Fix incorrect re-use of installer_* options.
12
+
13
+ ## 0.25.0 (2020-09-26)
14
+
15
+ - Renames mainline branch from "master" to "main"
16
+ - Fix not detecting running GuestAdditions on some systems [GH-347], [GH-376]. Thanks @Morac2 for [GH-377]
17
+ - Fixes package installation issues on CentOS 8.
18
+ CentOS installers no longe use the `--enablerepo` parameter when running `yum` to install packages.
19
+ Thanks @ghoneycutt for [GH-384]
20
+
21
+ ## 0.24.0 (2020-04-29)
22
+
23
+ No code changes to 0.24.0.beta1
24
+
25
+ ## 0.24.0.beta1 (2020-04-28)
26
+
27
+ - Add a new configuration `installer_options`, as an optional way to pass options to Installer classes.
28
+ - Add new `installer_options` for the CentOS Installer. Thanks @pedrofurtado for [GH-373]
29
+ + `allow_kernel_upgrade`: Will update the kernel and reboots the box
30
+ + `reboot_timeout`: Optionally, set the max amount of seconds to wait after reboot
31
+
1
32
  ## 0.23.0 (2020-01-05)
2
33
 
3
34
  - Fix Oracle Linux Installer. Installs `elfutils-libelf-devel`. [GH-364], @fribeiro1 [GH-365]
@@ -0,0 +1,76 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, sex characteristics, gender identity and expression,
9
+ level of experience, education, socio-economic status, nationality, personal
10
+ appearance, race, religion, or sexual identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at info@dotless.de. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72
+
73
+ [homepage]: https://www.contributor-covenant.org
74
+
75
+ For answers to common questions about this code of conduct, see
76
+ https://www.contributor-covenant.org/faq
data/Gemfile CHANGED
@@ -4,16 +4,16 @@ group :development do
4
4
  # We depend on Vagrant for development, but we don't add it as a
5
5
  # gem dependency because we expect to be installed within the
6
6
  # Vagrant environment itself using `vagrant plugin`.
7
- if ENV["VAGRANT_VERSION"]
8
- gem "vagrant", :git => "https://github.com/hashicorp/vagrant.git", tag: "v#{ENV["VAGRANT_VERSION"]}"
9
- elsif ENV["VAGRANT_LOCAL"]
10
- gem "vagrant", path: ENV["VAGRANT_LOCAL"]
7
+ if ENV['VAGRANT_VERSION']
8
+ gem 'vagrant', :git => 'https://github.com/hashicorp/vagrant.git', tag: "v#{ENV['VAGRANT_VERSION']}"
9
+ elsif ENV['VAGRANT_LOCAL']
10
+ gem 'vagrant', path: ENV['VAGRANT_LOCAL']
11
11
  else
12
- gem "vagrant", :git => "https://github.com/hashicorp/vagrant.git"
12
+ gem 'vagrant', :git => 'https://github.com/hashicorp/vagrant.git', branch: "main"
13
13
  end
14
- gem "rake", "~> 10.0"
14
+ gem 'rake', '>= 12.3.3'
15
15
  end
16
16
 
17
17
  group :plugins do
18
- gem "vagrant-vbguest", path: "."
18
+ gem 'vagrant-vbguest', path: '.'
19
19
  end
data/Readme.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [![Join the chat at https://gitter.im/dotless-de/vagrant-vbguest](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/dotless-de/vagrant-vbguest?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
6
6
  [![Code Climate](https://codeclimate.com/github/dotless-de/vagrant-vbguest.svg)](https://codeclimate.com/github/dotless-de/vagrant-vbguest)
7
- [![Inline docs](http://inch-ci.org/github/dotless-de/vagrant-vbguest.svg?branch=master)](http://inch-ci.org/github/dotless-de/vagrant-vbguest)
7
+ [![Inline docs](http://inch-ci.org/github/dotless-de/vagrant-vbguest.svg?branch=main)](http://inch-ci.org/github/dotless-de/vagrant-vbguest)
8
8
  [![Gem Version](https://badge.fury.io/rb/vagrant-vbguest.svg)](https://badge.fury.io/rb/vagrant-vbguest)
9
9
 
10
10
 
@@ -58,8 +58,53 @@ vbguest will try to autodetect the best option for your system. WTF? see below.
58
58
  * `no_remote` (Boolean, default: `false`) : Whether to _not_ download the iso file from a remote location. This includes any `http` location!
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
+ * `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.
61
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)
62
64
 
65
+
66
+ #### Installer Specific Options (`installer_options`)
67
+
68
+ Those settings are specific for OS-specific installer. Especially in a multi-box environment, you should put those options on the box configuration like this:
69
+
70
+ ```ruby
71
+ Vagrant.configure("2") do |config|
72
+ config.vm.define "my_cent_os_box" do |c|
73
+ c.box = "centos/8"
74
+ c.vbguest.installer_options = { allow_kernel_upgrade: true }
75
+ end
76
+ end
77
+ ```
78
+
79
+ Note that box-specific settings overwrite earlier settings:
80
+
81
+ ```ruby
82
+ Vagrant.configure("2") do |config|
83
+ config.vbguest.installer_options = { foo: 1, bar: 2 }
84
+
85
+ config.vm.define "a" do |box_config|
86
+ # not setting any `installer_options` will inherit the "global" ones
87
+ # installer_options => { foo: 1, bar: 2 }
88
+ end
89
+
90
+ config.vm.define "b" do |box_config|
91
+ # setting any `installer_options` will start from scratch
92
+ box_config.vbguest.installer_options[:zort] = 3 # => { zort: 3 }
93
+ end
94
+
95
+ config.vm.define "c" do |box_config|
96
+ # however, you can explicitly merge the global config
97
+ box_config.vbguest.installer_options = config.vbguest.installer_options.merge(zort: 3) # => { foo: 1, bar: 2, zort: 3 }
98
+ end
99
+ end
100
+ ```
101
+
102
+
103
+ ##### CentOS
104
+
105
+ * `:allow_kernel_upgrade` (default: `false`): If `true`, instead of trying to find matching the matching kernel-devel package to the installed kernel version, the kernel will be updated and the (now matching) up-to-date kernel-devel will be installed. __NOTE__: This will trigger a reboot of the box.
106
+ * `:reboot_timeout` (default: `300`): Maximum number of seconds to wait for the box to reboot after a kernel upgrade.
107
+
63
108
  #### Global Configuration
64
109
 
65
110
  Using [Vagrantfile Load Order](https://www.vagrantup.com/docs/vagrantfile/#load-order-and-merging) you may change default configuration values.
@@ -84,6 +129,26 @@ VagrantVbguest::Config.auto_update = false
84
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.
85
130
 
86
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
+
87
152
  ### Running as a middleware
88
153
 
89
154
  Running as a middleware is the default way of using *vagrant-vbguest*.
@@ -258,14 +323,14 @@ end
258
323
 
259
324
  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/)
260
325
 
261
- This project contains a [sample installer gem](https://github.com/dotless-de/vagrant-vbguest/tree/master/testdrive/vagrant-vbguest-unikorn) which might serve as an boilerplate.
326
+ This project contains a [sample installer gem](https://github.com/dotless-de/vagrant-vbguest/tree/main/testdrive/vagrant-vbguest-unikorn) which might serve as an boilerplate.
262
327
 
263
328
 
264
329
  ## Contributing
265
330
 
266
331
  Bug reports and pull requests are welcome on GitHub at https://github.com/dotless-de/vagrant-vbguest.
267
332
 
268
- For the forseeable future, no more pull requests will be accepted which add new guest support/installers. Please build your gem as a plugin to vbguest (see "Very Advanced Usage" section of this file). In fact, please open a pull request to remove support for a guest system if feel confident that your solution is better.
333
+ For the foreseeable future, no more pull requests will be accepted which add new guest support/installers. Please build your gem as a plugin to vbguest (see "Very Advanced Usage" section of this file). In fact, please open a pull request to remove support for a guest system if feel confident that your solution is better.
269
334
 
270
335
 
271
336
  ## Known Issues
@@ -0,0 +1,10 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ Only the latest version of vagrant-vbguest is supported and will receive security updates.
6
+
7
+ ## Reporting a Vulnerability
8
+
9
+ Download GPG key from: https://keybase.io/fnordfish/pgp_keys.asc (fingerprint `B3CA4DF4D703CBDFFF211CB8A8B249A38963D0B6`)
10
+ Write an gpg encrypted email to `vbguest-security@dotless.de`
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.23.0
1
+ 0.27.0
@@ -4,7 +4,8 @@ module VagrantVbguest
4
4
 
5
5
  module Attributes
6
6
  attr_accessor :auto_update, :auto_reboot, :no_install, :no_remote,
7
- :installer, :installer_arguments, :allow_downgrade,
7
+ :installer, :installer_arguments, :installer_options,
8
+ :installer_hooks, :allow_downgrade,
8
9
  :iso_path, :iso_upload_path, :iso_mount_point, :yes
9
10
  end
10
11
 
@@ -16,6 +17,8 @@ module VagrantVbguest
16
17
  def no_install; @no_install.nil? ? false : @no_install end
17
18
  def no_remote; @no_remote.nil? ? false : @no_remote end
18
19
  def installer_arguments; @installer_arguments.nil? ? '--nox11' : @installer_arguments end
20
+ def installer_options; @installer_options ||= {} end
21
+ def installer_hooks; @installer_hooks ||= {} end
19
22
  def yes; @yes.nil? ? true : @yes end
20
23
 
21
24
  def iso_path
@@ -32,7 +35,9 @@ module VagrantVbguest
32
35
  def auto_reboot; @auto_reboot.nil? ? self.class.auto_reboot : @auto_reboot end
33
36
  def no_install; @no_install.nil? ? self.class.no_install : @no_install end
34
37
  def no_remote; @no_remote.nil? ? self.class.no_remote : @no_remote end
35
- def installer_arguments; @installer_arguments.nil? ? self.class.installer_arguments : @installer_arguments 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
36
41
  def yes; @yes.nil? ? self.class.yes : @yes end
37
42
 
38
43
  def iso_path
@@ -47,6 +52,8 @@ module VagrantVbguest
47
52
  {
48
53
  :installer => installer,
49
54
  :installer_arguments => installer_arguments,
55
+ :installer_options => installer_options,
56
+ :installer_hooks => installer_hooks,
50
57
  :iso_path => iso_path,
51
58
  :iso_upload_path => iso_upload_path,
52
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
- installer.install do |type, data|
64
- @env.ui.info(data, :prefix => false, :new_line => false)
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
- installer.rebuild do |type, data|
75
- @env.ui.info(data, :prefix => false, :new_line => false)
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
- installer.start do |type, data|
84
- @env.ui.info(data, :prefix => false, :new_line => false)
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
 
@@ -145,8 +151,32 @@ module VagrantVbguest
145
151
  end
146
152
 
147
153
  def cleanup
148
- @guest_installer.cleanup if @guest_installer
154
+ return unless @guest_installer
155
+
156
+ @guest_installer.cleanup do |type, data|
157
+ @env.ui.info(data, :prefix => false, :new_line => false)
158
+ end
149
159
  end
150
160
 
161
+ def with_hooks(step_name)
162
+ run_hook(:"before_#{step_name}")
163
+ ret = yield
164
+ run_hook(:"after_#{step_name}")
165
+
166
+ ret
167
+ end
168
+
169
+ def run_hook(hook_name)
170
+ hooks = @options.dig(:installer_hooks, hook_name)
171
+
172
+ return if !hooks || hooks.empty?
173
+
174
+ @vm.ui.info I18n.t("vagrant_vbguest.installer_hooks.#{hook_name}")
175
+ Array(hooks).each do |l|
176
+ @vm.communicate.sudo(l) do |type, data|
177
+ @env.ui.info(data, :prefix => false, :new_line => false)
178
+ end
179
+ end
180
+ end
151
181
  end
152
182
  end
@@ -181,6 +181,10 @@ module VagrantVbguest
181
181
  version
182
182
  end
183
183
 
184
+ def installer_options
185
+ options[:installer_options] || {}
186
+ end
187
+
184
188
  # Helper to yield a warning message to the user, that the installation
185
189
  # will start _now_.
186
190
  # The message includes the host and installer version strings.
@@ -232,12 +236,13 @@ module VagrantVbguest
232
236
 
233
237
  # A helper method to delete the uploaded GuestAdditions iso file
234
238
  # from the guest box
235
- def cleanup
239
+ def cleanup(opts, &block)
236
240
  unless options[:no_cleanup]
237
241
  @host.cleanup
238
- communicate.execute("test -f #{tmp_path} && rm #{tmp_path}", :error_check => false) do |type, data|
239
- env.ui.error(data.chomp, :prefix => false)
240
- end
242
+
243
+ opts = (opts || {}).merge(:error_check => false)
244
+ block ||= proc { |type, data| env.ui.error(data.chomp, :prefix => false) }
245
+ communicate.execute("test -f #{tmp_path} && rm #{tmp_path}", opts, &block)
241
246
  end
242
247
  end
243
248
  end
@@ -8,12 +8,27 @@ module VagrantVbguest
8
8
 
9
9
  # Install missing deps and yield up to regular linux installation
10
10
  def install(opts=nil, &block)
11
- install_kernel_deps(opts, &block)
11
+ if upgrade_kernel?
12
+ upgrade_kernel(opts, &block)
13
+ else
14
+ install_kernel_deps(opts, &block)
15
+ end
12
16
  super
13
17
  end
14
18
 
19
+ def installer_options
20
+ @installer_options ||= {
21
+ allow_kernel_upgrade: false,
22
+ reboot_timeout: 300
23
+ }.merge!(super)
24
+ end
25
+
15
26
  protected
16
27
 
28
+ def upgrade_kernel?
29
+ installer_options[:allow_kernel_upgrade]
30
+ end
31
+
17
32
  def install_kernel_deps(opts=nil, &block)
18
33
  unless has_kernel_devel_info?
19
34
  update_release_repos(opts, &block)
@@ -31,7 +46,7 @@ module VagrantVbguest
31
46
  def has_rel_repo?
32
47
  unless instance_variable_defined?(:@has_rel_repo)
33
48
  rel = release_version
34
- @has_rel_repo = communicate.test("yum repolist --enablerepo=C#{rel}-base --enablerepo=C#{rel}-updates")
49
+ @has_rel_repo = communicate.test('yum repolist')
35
50
  end
36
51
  @has_rel_repo
37
52
  end
@@ -54,16 +69,30 @@ module VagrantVbguest
54
69
 
55
70
  def install_kernel_devel(opts=nil, &block)
56
71
  rel = has_rel_repo? ? release_version : '*'
57
- cmd = "yum install -y kernel-devel-`uname -r` --enablerepo=C#{rel}-base --enablerepo=C#{rel}-updates"
72
+ cmd = 'yum install -y kernel-devel-`uname -r`'
58
73
  communicate.sudo(cmd, opts, &block)
59
74
  end
60
75
 
76
+ def upgrade_kernel(opts=nil, &block)
77
+ communicate.sudo('yum update -y kernel', opts, &block)
78
+ communicate.sudo('yum install -y kernel-devel', opts, &block)
79
+
80
+ env.ui.info(I18n.t("vagrant_vbguest.centos.rebooting", vm_name: vm.name))
81
+ communicate.sudo('shutdown -r now', opts, &block)
82
+
83
+ sleep_guard = installer_options[:reboot_timeout]
84
+ begin
85
+ sleep 10
86
+ sleep_guard -= 10
87
+ end while sleep_guard >= 0 && !@vm.communicate.ready?
88
+ end
89
+
61
90
  def dependencies
62
- if has_kernel_devel_info?
91
+ if !upgrade_kernel? && has_kernel_devel_info?
63
92
  # keep the original redhat dependencies
64
93
  super
65
94
  else
66
- # we should have installed kernel-devel-`uname -r` via install_kernel_devel
95
+ # we should have installed kernel-devel(-`uname -r`) via install_kernel_devel or upgrade_kernel
67
96
  ['gcc', 'binutils', 'make', 'perl', 'bzip2', 'elfutils-libelf-devel'].join(' ')
68
97
  end
69
98
  end
@@ -24,7 +24,7 @@ module VagrantVbguest
24
24
 
25
25
  protected
26
26
  def install_dependencies_cmd
27
- "apt-get install -y #{dependencies}"
27
+ "DEBIAN_FRONTEND=noninteractive apt-get install -y #{dependencies}"
28
28
  end
29
29
 
30
30
  def dependencies
@@ -67,7 +67,6 @@ module VagrantVbguest
67
67
  mount_iso(opts, &block)
68
68
  execute_installer(opts, &block)
69
69
  start(opts, &block)
70
- unmount_iso(opts, &block) unless options[:no_cleanup]
71
70
  end
72
71
 
73
72
  # @param opts [Hash] Optional options Hash wich meight get passed to {Vagrant::Communication::SSH#execute} and firends
@@ -78,7 +77,7 @@ module VagrantVbguest
78
77
  opts = {
79
78
  :sudo => true
80
79
  }.merge(opts || {})
81
- communicate.test('grep -qE "^vboxguest\s.+\s\([^\s]*O[^\s]*\)$" /proc/modules && ls /lib/modules/`uname -r`/misc/vboxsf.ko*', opts, &block)
80
+ communicate.test('grep -qE "^vboxguest\b.*vboxsf\b" /proc/modules', opts, &block)
82
81
  end
83
82
 
84
83
  # This overrides {VagrantVbguest::Installers::Base#guest_version}
@@ -269,6 +268,13 @@ module VagrantVbguest
269
268
  env.ui.info(I18n.t("vagrant_vbguest.unmounting_iso", :mount_point => mount_point))
270
269
  communicate.sudo("umount #{mount_point}", opts, &block)
271
270
  end
271
+
272
+ def cleanup(opts=nil, &block)
273
+ unless options[:no_cleanup]
274
+ unmount_iso(opts, &block)
275
+ super
276
+ end
277
+ end
272
278
  end
273
279
  end
274
280
  end
@@ -16,7 +16,11 @@ module VagrantVbguest
16
16
 
17
17
  protected
18
18
  def install_dependencies_cmd
19
- "yum install -y #{dependencies}"
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
- 'perl',
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
@@ -51,7 +51,6 @@ module VagrantVbguest
51
51
  upload(iso_file)
52
52
  mount_iso(opts, &block)
53
53
  execute_installer(opts, &block)
54
- unmount_iso(opts, &block) unless options[:no_cleanup]
55
54
  end
56
55
 
57
56
  def reboot_after_install?(opts = nil, &block)
@@ -113,6 +112,13 @@ module VagrantVbguest
113
112
  communicate.execute("Remove-Item -Path #{tmp_path}", opts, &block)
114
113
  end
115
114
 
115
+ def cleanup(opts = nil, &block)
116
+ unless options[:no_cleanup]
117
+ unmount_iso(opts, &block)
118
+ super
119
+ end
120
+ end
121
+
116
122
  def yield_installation_error_warning(path_to_installer)
117
123
  @env.ui.warn I18n.t(
118
124
  "vagrant_vbguest.windows.install_error",
@@ -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.
@@ -0,0 +1,4 @@
1
+ en:
2
+ vagrant_vbguest:
3
+ centos:
4
+ rebooting: "[%{vm_name}] Rebooting after kernel upgrade."
@@ -23,4 +23,10 @@ Gem::Specification.new do |s|
23
23
  s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
24
  s.require_paths = ["lib"]
25
25
 
26
+ s.metadata = {
27
+ "bug_tracker_uri" => "https://github.com/dotless-de/vagrant-vbguest/issues",
28
+ "changelog_uri" => "https://github.com/dotless-de/vagrant-vbguest/blob/main/CHANGELOG.md",
29
+ "documentation_uri" => "http://rubydoc.info/gems/vagrant-vbguest",
30
+ "source_code_uri" => "https://github.com/dotless-de/vagrant-vbguest"
31
+ }
26
32
  end
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.23.0
4
+ version: 0.27.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Schulze
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-05 00:00:00.000000000 Z
11
+ date: 2020-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: micromachine
@@ -66,13 +66,16 @@ executables: []
66
66
  extensions: []
67
67
  extra_rdoc_files: []
68
68
  files:
69
+ - ".github/dependabot.yml"
69
70
  - ".github/stale.yml"
70
71
  - ".gitignore"
71
72
  - CHANGELOG.md
73
+ - CODE_OF_CONDUCT.md
72
74
  - Gemfile
73
75
  - LICENSE
74
76
  - Rakefile
75
77
  - Readme.md
78
+ - SECURITY.md
76
79
  - VERSION
77
80
  - lib/vagrant-vbguest.rb
78
81
  - lib/vagrant-vbguest/command.rb
@@ -101,13 +104,18 @@ files:
101
104
  - lib/vagrant-vbguest/middleware.rb
102
105
  - lib/vagrant-vbguest/version.rb
103
106
  - locales/en.yml
107
+ - locales/en_centos.yml
104
108
  - locales/en_windows.yml
105
109
  - vagrant-vbguest.gemspec
106
110
  homepage: https://github.com/dotless-de/vagrant-vbguest
107
111
  licenses:
108
112
  - MIT
109
- metadata: {}
110
- post_install_message:
113
+ metadata:
114
+ bug_tracker_uri: https://github.com/dotless-de/vagrant-vbguest/issues
115
+ changelog_uri: https://github.com/dotless-de/vagrant-vbguest/blob/main/CHANGELOG.md
116
+ documentation_uri: http://rubydoc.info/gems/vagrant-vbguest
117
+ source_code_uri: https://github.com/dotless-de/vagrant-vbguest
118
+ post_install_message:
111
119
  rdoc_options: []
112
120
  require_paths:
113
121
  - lib
@@ -123,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
131
  version: 1.3.6
124
132
  requirements: []
125
133
  rubygems_version: 3.0.3
126
- signing_key:
134
+ signing_key:
127
135
  specification_version: 4
128
136
  summary: A Vagrant plugin to install the VirtualBoxAdditions into the guest VM
129
137
  test_files: []