vagrant-vbguest 0.24.0.beta1 → 0.28.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: ee59eb428fab8a82265073af563afac3cf1eb44ef7c39d7b295006f296541b28
4
- data.tar.gz: 7cbf7aebdef759adaabd66ad72db101cfe777150348809188c6dfa8021a20163
3
+ metadata.gz: bc57b2bf840ee96da32c6d2c1e76068f7e7b621009b5cb18ae11f961cfab640a
4
+ data.tar.gz: 5cbbec9f20453b9bb42a03895d7a6f53cebecbca7879fe18e2389aae98849420
5
5
  SHA512:
6
- metadata.gz: 25a9d0bdd3d5f8abe459aae553b2074f3222550a14a82df5e774274d5be67c0c3ac16831064e9f1f1a8e1ac86deab89d38944cecd3aebf56fa4ca8c600c54e30
7
- data.tar.gz: 28edf44b31602f72df2c2458a51b9f414561af4ea06b1674bd02f2793044b9294512135be8935b7b6461c365633b185e0f9901be6996060b8273faba394a4fa1
6
+ metadata.gz: 63162302dfa737249d5e27ebca8702b044c5ed941020349d3f08825896c30b0e44705135c2074f83b7db46d56da4bad815e508f02d3e51b96262772db1361690
7
+ data.tar.gz: 34d4263fab308a00acc2df865a924d8a913a4322b7789ba82687be691ed6614fd188189b477dc1e28c232940d2a3d19cb6787e02a117a62ae70cf4305cc6a107
@@ -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,31 @@
1
+ ## 0.28.0 (2020-11-20)
2
+
3
+ - Work around a bug in vagrant 2.2.11 to 2.2.13, which would not load the vbguest middleware. [GH-394], Fixes [GH-391]
4
+
5
+ ## 0.27.0 (2020-11-15)
6
+
7
+ - Un-mounting the guest additions iso will now take place in the cleanup step [GH-393]
8
+ - Running detection now checks for vboxguest and vboxsf kernel module. [GH-392], Fixes [GH-387]
9
+
10
+ ## 0.26.0 (2020-10-30)
11
+
12
+ - Add a new configuration `installer_hooks` allows to configure arbitrary scripts to be run on the guest before/after installer steps are executed.
13
+ - Fix RHEL8 perl vs. perl-interpreter [GH-368]
14
+ - On RedHat, use `dnf` instead of `yum` if available. [GH-368]
15
+ - Fix incorrect re-use of installer_* options.
16
+
17
+ ## 0.25.0 (2020-09-26)
18
+
19
+ - Renames mainline branch from "master" to "main"
20
+ - Fix not detecting running GuestAdditions on some systems [GH-347], [GH-376]. Thanks @Morac2 for [GH-377]
21
+ - Fixes package installation issues on CentOS 8.
22
+ CentOS installers no longe use the `--enablerepo` parameter when running `yum` to install packages.
23
+ Thanks @ghoneycutt for [GH-384]
24
+
25
+ ## 0.24.0 (2020-04-29)
26
+
27
+ No code changes to 0.24.0.beta1
28
+
1
29
  ## 0.24.0.beta1 (2020-04-28)
2
30
 
3
31
  - Add a new configuration `installer_options`, as an optional way to pass options to Installer classes.
@@ -76,7 +104,7 @@ See discussion in [GH-300]. Thanks @cbj4074 for asking the right questions.
76
104
 
77
105
  ## 0.15.2 (2018-05-22)
78
106
 
79
- - On RedHad based guest, the installer will now try to install the 'kernel-devel' package additionally to 'kernel-devel-`uname -r`' Thanks @ghoneycutt [GH-299]
107
+ - On RedHat based guest, the installer will now try to install the 'kernel-devel' package additionally to 'kernel-devel-`uname -r`' Thanks @ghoneycutt [GH-299]
80
108
 
81
109
  ## 0.15.1 (2018-01-08)
82
110
 
@@ -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", ">= 12.3.3"
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
 
@@ -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
 
@@ -75,10 +76,34 @@ Vagrant.configure("2") do |config|
75
76
  end
76
77
  ```
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
+
78
103
  ##### CentOS
79
104
 
80
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.
81
- * `:reboot_timeout` (default: `300`): Number of seconds to wait for the box to reboot after a kernel upgrade.
106
+ * `:reboot_timeout` (default: `300`): Maximum number of seconds to wait for the box to reboot after a kernel upgrade.
82
107
 
83
108
  #### Global Configuration
84
109
 
@@ -104,6 +129,26 @@ VagrantVbguest::Config.auto_update = false
104
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.
105
130
 
106
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
+
107
152
  ### Running as a middleware
108
153
 
109
154
  Running as a middleware is the default way of using *vagrant-vbguest*.
@@ -278,14 +323,14 @@ end
278
323
 
279
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/)
280
325
 
281
- 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.
282
327
 
283
328
 
284
329
  ## Contributing
285
330
 
286
331
  Bug reports and pull requests are welcome on GitHub at https://github.com/dotless-de/vagrant-vbguest.
287
332
 
288
- 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.
289
334
 
290
335
 
291
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.24.0.beta1
1
+ 0.28.0
@@ -31,8 +31,6 @@ require 'vagrant-vbguest/installers/suse'
31
31
  require 'vagrant-vbguest/installers/archlinux'
32
32
  require 'vagrant-vbguest/installers/windows'
33
33
 
34
- require 'vagrant-vbguest/middleware'
35
-
36
34
  module VagrantVbguest
37
35
 
38
36
  class Plugin < Vagrant.plugin("2")
@@ -52,13 +50,26 @@ module VagrantVbguest
52
50
  Command
53
51
  end
54
52
 
55
- # hook after anything that boots:
56
- # that's all middlewares which will run the buildin "VM::Boot" action
57
- action_hook('vbguest') do |hook|
58
- if defined?(VagrantPlugins::ProviderVirtualBox::Action::CheckGuestAdditions)
59
- hook.before(VagrantPlugins::ProviderVirtualBox::Action::CheckGuestAdditions, VagrantVbguest::Middleware)
60
- else
61
- hook.after(VagrantPlugins::ProviderVirtualBox::Action::Boot, VagrantVbguest::Middleware)
53
+ if ("2.2.11".."2.2.13").include?(Gem::Version.create(Vagrant::VERSION).release.to_s)
54
+ $stderr.puts(
55
+ "Vagrant v#{Vagrant::VERSION} has a bug which prevents vagrant-vbguest to register probably.\n" \
56
+ "vagrant-vbguest will try to do the next best thing, but might not be working as expected.\n" \
57
+ "If possible, please upgrade Vagrant to >= 2.2.14"
58
+ )
59
+ action_hook('vbguest', :machine_action_up) do |hook|
60
+ require 'vagrant-vbguest/middleware'
61
+ hook.append(VagrantVbguest::Middleware)
62
+ end
63
+ else
64
+ # hook after anything that boots:
65
+ # that's all middlewares which will run the buildin "VM::Boot" action
66
+ action_hook('vbguest') do |hook|
67
+ require 'vagrant-vbguest/middleware'
68
+ if defined?(VagrantPlugins::ProviderVirtualBox::Action::CheckGuestAdditions)
69
+ hook.before(VagrantPlugins::ProviderVirtualBox::Action::CheckGuestAdditions, VagrantVbguest::Middleware)
70
+ else
71
+ hook.after(VagrantPlugins::ProviderVirtualBox::Action::Boot, VagrantVbguest::Middleware)
72
+ end
62
73
  end
63
74
  end
64
75
  end
@@ -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
- 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
@@ -236,12 +236,13 @@ module VagrantVbguest
236
236
 
237
237
  # A helper method to delete the uploaded GuestAdditions iso file
238
238
  # from the guest box
239
- def cleanup
239
+ def cleanup(opts, &block)
240
240
  unless options[:no_cleanup]
241
241
  @host.cleanup
242
- communicate.execute("test -f #{tmp_path} && rm #{tmp_path}", :error_check => false) do |type, data|
243
- env.ui.error(data.chomp, :prefix => false)
244
- 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)
245
246
  end
246
247
  end
247
248
  end
@@ -46,7 +46,7 @@ module VagrantVbguest
46
46
  def has_rel_repo?
47
47
  unless instance_variable_defined?(:@has_rel_repo)
48
48
  rel = release_version
49
- @has_rel_repo = communicate.test("yum repolist --enablerepo=C#{rel}-base --enablerepo=C#{rel}-updates")
49
+ @has_rel_repo = communicate.test('yum repolist')
50
50
  end
51
51
  @has_rel_repo
52
52
  end
@@ -69,7 +69,7 @@ module VagrantVbguest
69
69
 
70
70
  def install_kernel_devel(opts=nil, &block)
71
71
  rel = has_rel_repo? ? release_version : '*'
72
- 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`'
73
73
  communicate.sudo(cmd, opts, &block)
74
74
  end
75
75
 
@@ -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.
@@ -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.24.0.beta1
4
+ version: 0.28.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-04-28 00:00:00.000000000 Z
11
+ date: 2020-11-20 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
@@ -107,8 +110,12 @@ files:
107
110
  homepage: https://github.com/dotless-de/vagrant-vbguest
108
111
  licenses:
109
112
  - MIT
110
- metadata: {}
111
- 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:
112
119
  rdoc_options: []
113
120
  require_paths:
114
121
  - lib
@@ -124,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
131
  version: 1.3.6
125
132
  requirements: []
126
133
  rubygems_version: 3.0.3
127
- signing_key:
134
+ signing_key:
128
135
  specification_version: 4
129
136
  summary: A Vagrant plugin to install the VirtualBoxAdditions into the guest VM
130
137
  test_files: []