voxpupuli / puppet-virtualbox

A Puppet module to install and manage VirtualBox
https://forge.puppet.com/puppet/virtualbox
Apache License 2.0
5 stars 29 forks source link

upgrade virtualbox #21

Closed mmarseglia closed 6 years ago

mmarseglia commented 9 years ago

Hello,

Is it possible to upgrade virtualbox using this module if I specify a newer version than what is currently installed?

danzilio commented 9 years ago

Hi @mmarseglia! Yes, you can use the version parameter to specify the major version you'd like to install. For example, if you'd like to install VirtualBox 5, you can set version => '5.0' on the virtualbox class.

mmarseglia commented 9 years ago

And that will upgrade an existing install? On Oct 4, 2015 2:07 PM, "David Danzilio" notifications@github.com wrote:

Hi @mmarseglia https://github.com/mmarseglia! Yes, you can use the version parameter to specify the major version you'd like to install. For example, if you'd like to install VirtualBox 5, you can set version => '5.0' on the virtualbox class.

— Reply to this email directly or view it on GitHub https://github.com/danzilio/danzilio-virtualbox/issues/21#issuecomment-145370249 .

danzilio commented 9 years ago

Sure will!

mmarseglia commented 9 years ago

I tried that and puppet fails. I'm on CentOS 6.6.

Execution of '/usr/bin/yum -d 0 -e 0 -y install VirtualBox-5.0' returned 1: Transaction Check Error: file /usr/bin/VBox from install of VirtualBox-5.0-5.0.6_103037_el6-1.x86_64 conflicts with file from package VirtualBox-4.3-4.3.30_101610_el6-1.x86_64 file /usr/lib/virtualbox/VBoxAutostart from install of VirtualBox-5.0-5.0.6_103037_el6-1.x86_64 conflicts with file from package VirtualBox-4.3-4.3.30_101610_el6-1.x86_64 file

danzilio commented 9 years ago

Sorry about that! I just tried this and it looks like there's no direct upgrade path between major versions. In order to upgrade from 4.X to 5 you'll need to uninstall VirtualBox first. IMHO this was a rather unfortunate packaging decision on the part of the VirtualBox team.

mmarseglia commented 9 years ago

what do you think about adding a conditional that would uninstall version 4 if it is detected? there is the virtualbox_version fact available.

maybe something like this pseudocode would handle upgrades and downgrades?

  if $manage_package then
   if detected virtualbox version matches 4.x and $version does not match 4.x then

      uninstall detected virtualbox version 
      install virtualbox normally

   else
      install virtualbox normally
  end if
end if
dhollinger commented 6 years ago

solved by #72