patilvinay / ubuntu-18.04-cert-manager-dev-box

This vagrant box is a development environment required to build and e2e test cert-manager.
0 stars 0 forks source link

Support libvirt provider #1

Open wallrj opened 4 years ago

wallrj commented 4 years ago

Hey @patilvinay

I downloaded the Vagrantfile and ran it on my Fedora 31 laptop.

It only supports Virtualbox. Would it be possible to make it more generic so that it can work with libvirt too?

$ wget https://raw.githubusercontent.com/patilvinay/ubuntu-18.04-cert-manager-dev-box/master/Vagrantfile
$ vagrant up
Bringing machine 'default' up with 'libvirt' provider...
==> default: Box 'vinaypatil/ubuntu-18.04-cert-manager-dev-box' could not be found. Attempting to find and install...
    default: Box Provider: libvirt
    default: Box Version: 0.0.1
==> default: Loading metadata for box 'vinaypatil/ubuntu-18.04-cert-manager-dev-box'
    default: URL: https://vagrantcloud.com/vinaypatil/ubuntu-18.04-cert-manager-dev-box
The box you're attempting to add doesn't support the provider
you requested. Please find an alternate box or use an alternate
provider. Double-check your requested provider to verify you didn't
simply misspell it.

If you're adding a box from HashiCorp's Vagrant Cloud, make sure the box is
released.

Name: vinaypatil/ubuntu-18.04-cert-manager-dev-box
Address: https://vagrantcloud.com/vinaypatil/ubuntu-18.04-cert-manager-dev-box
Requested provider: [:libvirt]
patilvinay commented 4 years ago

I am checking if libvirt provider can be added

wallrj commented 4 years ago

I am checking if libvirt provider can be added

Even better would be if the box could work with multiple providers. I seem to remember it being possible when I last used Vagrant and the docs hint at it:

The Vagrant Way: The proper "Vagrant way" is to avoid any provider-specific overrides if possible by making boxes for multiple providers that are as identical as possible, since box names can map to multiple providers. However, this is not always possible, and in those cases, overrides are available. https://www.vagrantup.com/docs/providers/configuration.html

But also consider moving your ansible scripts into this repo and making them part of the Vagrantfile.

(I recall you saying that you used ansible to install all the dependencies....but I might be misremembering)

wallrj commented 4 years ago

Ah, I see that the Ansible scripts are in your other repo: https://github.com/patilvinay/vagrant-ubuntu-18.04

So perhaps I'm misunderstanding how you intend this repo to be used.

patilvinay commented 4 years ago

@wallrj Thank you for the pointers. There are very few or insignificant provider specific overrides in the box image. How ever the base image seems to support only virtual box, vmware and hyper-v https://app.vagrantup.com/hashicorp/boxes/bionic64

I will build a box with generic/ubuntu1804. https://app.vagrantup.com/generic/boxes/ubuntu1804
which supports wider providers

The other repo you mentioned has all the ansible play in source. I thought one clean vagrantfile would be easy to install. And the box I uploaded on https://app.vagrantup.com/vinaypatil/boxes/ubuntu-18.04-cert-manager-dev-box is packaged box with all the ansible plays pre-executed.