vagrant-vbguest 0.22.1 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da79bc0ea1de83aaff4441411b30ccdda0d2e340a4b9005ba3881f3e99663b46
4
- data.tar.gz: c417bfc0b198f54de1c1c310ebcc4cbadd0a1cd81547a45de0e959ff3eac8126
3
+ metadata.gz: b7a6d0a4fb842515ecb1dd74ecb969b916c9673aaefabad4f866e84a4fadcdd5
4
+ data.tar.gz: c799100151565c5bced4e1efdc1af7e833fb8e01b1ab6ec74ec94d01e7f05676
5
5
  SHA512:
6
- metadata.gz: 8470f53fcf0e23be79343e1a6660c94ea5fec4d731d90df5aced9f5e2f4de6791a3f99caf2872043280892e254def2d7003b125c2008c444a9852bc95d9ab3f5
7
- data.tar.gz: 8591bff9dabf621cbc8ad3a6e92f6b3a0eaa25a8630a713085dd1f2ae21a5d06cf52993058af9cae3d5e186b75c88d3f1678a55d5ffb0a88d23f0cebcfe0843d
6
+ metadata.gz: 14ae4c8c9751d61040c7658d487271a2fdcd7f55f734a1487921c15d05cc97f175aafafde2e1787cadd48c05259f4dcfde4aac3e810c0b1723dd228d3e41af8f
7
+ data.tar.gz: 5791807d0b50e929402798b41647306c1edb40e434b25c9264c633bb2c76f8c4b02e18012488a5ef136fee0616777c46daaee044fcdaca066241f8d9372f1a06
@@ -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.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)
9
+
10
+ - Renames mainline branch from "master" to "main"
11
+ - Fix not detecting running GuestAdditions on some systems [GH-347], [GH-376]. Thanks @Morac2 for [GH-377]
12
+ - Fixes package installation issues on CentOS 8.
13
+ CentOS installers no longe use the `--enablerepo` parameter when running `yum` to install packages.
14
+ Thanks @ghoneycutt for [GH-384]
15
+
16
+ ## 0.24.0 (2020-04-29)
17
+
18
+ No code changes to 0.24.0.beta1
19
+
20
+ ## 0.24.0.beta1 (2020-04-28)
21
+
22
+ - Add a new configuration `installer_options`, as an optional way to pass options to Installer classes.
23
+ - Add new `installer_options` for the CentOS Installer. Thanks @pedrofurtado for [GH-373]
24
+ + `allow_kernel_upgrade`: Will update the kernel and reboots the box
25
+ + `reboot_timeout`: Optionally, set the max amount of seconds to wait after reboot
26
+
27
+ ## 0.23.0 (2020-01-05)
28
+
29
+ - Fix Oracle Linux Installer. Installs `elfutils-libelf-devel`. [GH-364], @fribeiro1 [GH-365]
30
+
31
+
1
32
  ## 0.22.0 (2019-12-06)
2
33
 
3
34
  - Fix checking for `vboxadd` tools. [GH-362]
@@ -6,7 +37,7 @@
6
37
 
7
38
  - Opensuse installer now uninstalls packaged guest additions
8
39
  - Fix error trying to rebuild/start guest additions when no `vboxadd` to is present [GH-358]
9
- - Fiy Oracle installer to support non UEK kernel. [GH-357]
40
+ - Fix Oracle installer to support non UEK kernel. [GH-357]
10
41
 
11
42
  ## 0.21.0 (2019-11-11)
12
43
 
@@ -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'
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.22.1
1
+ 0.26.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
 
@@ -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
@@ -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.
@@ -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
@@ -78,7 +78,7 @@ module VagrantVbguest
78
78
  opts = {
79
79
  :sudo => true
80
80
  }.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)
81
+ communicate.test('grep -qE "^vboxguest\s.+\s" /proc/modules && ls /lib/modules/`uname -r`/misc/vboxsf.ko*', opts, &block)
82
82
  end
83
83
 
84
84
  # This overrides {VagrantVbguest::Installers::Base#guest_version}
@@ -15,7 +15,8 @@ module VagrantVbguest
15
15
  'gcc',
16
16
  'make',
17
17
  'perl',
18
- 'bzip2'
18
+ 'bzip2',
19
+ 'elfutils-libelf-devel'
19
20
  ].join(' ')
20
21
  end
21
22
  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
@@ -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.22.1
4
+ version: 0.26.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: 2019-12-06 00:00:00.000000000 Z
11
+ date: 2020-10-30 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: []