Skip to content

Comments

Default to using bento boxes for vagrant hypervisor#449

Closed
silug wants to merge 1 commit intovoxpupuli:masterfrom
silug:issue_447
Closed

Default to using bento boxes for vagrant hypervisor#449
silug wants to merge 1 commit intovoxpupuli:masterfrom
silug:issue_447

Conversation

@silug
Copy link
Contributor

@silug silug commented Jan 27, 2026

Replace the default generic boxes with equivalent bento boxes for the vagrant hypervisor.

Fixes #447

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a more generic ostype_to_box method is better. I think it's something like

def ostype_to_box(ostype)
  case ostype
  when /^almalinux(\d+)/
    ostype.sub(/(\d)/, '/\1')
  when /^centos(\d+)/
    version = Regexp.last_match(1)
    if version.to_i >= 8 
      "centos/stream#{version}"
    else
      "centos/#{version}"
    end
  when /^debian(\d+)/
    version = Regexp.last_match(1)
    if (codename = DEBIAN_VERSION_CODES[version])
      "debian/#{codename}64"
    else
      nil
    end
  when /^fedora/
    ostype.sub(/(\d)/, '/\1') + '-cloud-base'
  when /ubuntu(\d\d)(\d\d)/
    version = "#{Regexp.last_match(1)}.#{Regexp.last_match(2)}"
    "bento/ubuntu-#{version}"
  when /^([a-z]+)(\d+)$/
    os_name = Regexp.last_match(1)
    version = Regexp.last_match(2)

    bento_os_name = OSTYPE_TO_BENTO_OS_NAME.fetch(os_name, os_name)

    "bento/#{bento_os_name}-#{version}"
  else
    # Fallback to generic if pattern doesn't match
    "generic/#{ostype}"
  end
end

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving is a bit like approving my own work.

@silug silug marked this pull request as draft February 9, 2026 17:42
@silug silug marked this pull request as ready for review February 11, 2026 19:49
Replace the default `generic` boxes with equivalent `bento` boxes for the vagrant hypervisor.

Fixes voxpupuli#447
@bastelfreak
Copy link
Member

@silug did you do some testing in one of our modules? do the images bring the same packages we rely on/assume?

@silug
Copy link
Contributor Author

silug commented Feb 11, 2026

@silug did you do some testing in one of our modules? do the images bring the same packages we rely on/assume?

@bastelfreak I have not.

Even if everything is there, I won't be shocked if there is some breakage given that the generic boxes haven't been updated in 2 years. (Unfortunately that also means that there are no generic boxes for any OS that has been released in the last 2 years.)

What would be the best way to test this out? Look for modules that use vagrant in GHA and open throw-away PRs that use this branch of the gem? (Even if vagrant works locally, I worry that there will be something that makes it blow up on the GHA runners.)

@silug
Copy link
Contributor Author

silug commented Feb 11, 2026

I'm going to close this PR. The bento boxes don't reliably have libvirt support. That makes them somewhat useless in GHA.

@silug silug closed this Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

generic vagrant boxes are dead

3 participants