Introduction
We recently made some changes in the way we publish Oracle Linux Vagrant Boxes. First, we added boxes for the libvirt provider, for use with KVM. Secondly, we added Vagrant catalog data in JSON format.
Vagrant Box Catalog Data
With the catalog data in place, instead of launching vagrant environments using a URL to a box file, you launch it by pointing to a JSON file.
For example:
$ vagrant init oraclelinux/7 https://oracle.github.io/vagrant-boxes/boxes/oraclelinux/7.json $ vagrant up $ vagrant ssh
This creates a Vagrantfile that includes the following two lines causes the most recently published Oracle Linux 7 box to be downloaded (if needed) and started:
config.vm.box = "oraclelinux/7" config.vm.box_url = "https://oracle.github.io/vagrant-boxes/boxes/oraclelinux/7.json"
Using this catalog-based approach to referencing Vagrant boxes, adds version-awareness and the ability to update boxes. During vagrant up you’ll be notified when a newer version of a box is available for your environment:
$ vagrant up; vagrant ssh Bringing machine 'default' up with 'virtualbox' provider... ==> default: Checking if box 'oraclelinux/7' version '7.7.15' is up to date... ==> default: A newer version of the box 'oraclelinux/7' for provider 'virtualbox' is ==> default: available! You currently have version '7.7.15'. The latest is version ==> default: '7.8.128'. Run `vagrant box update` to update.
To update a box:
$ vagrant box update
==> default: Checking for updates to 'oraclelinux/7'
default: Latest installed version: 7.7.15
default: Version constraints:
default: Provider: virtualbox
==> default: Updating 'oraclelinux/7' with provider 'virtualbox' from version
==> default: '7.7.15' to '7.8.128'...
==> default: Loading metadata for box 'https://oracle.github.io/vagrant-boxes/boxes/oraclelinux/7.json'
==> default: Adding box 'oraclelinux/7' (v7.8.128) for provider: virtualbox
default: Downloading: https://yum.oracle.com/boxes/oraclelinux/ol7/ol7u8-virtualbox-b128.box
default: Calculating and comparing box checksum...
==> default: Successfully added box 'oraclelinux/7' (v7.8.128) for 'virtualbox'!
To check if a later version of a box is available:
$ vagrant box outdated --global * 'rpmcheck' for 'virtualbox' wasn't added from a catalog, no version information * 'oraclelinux/7' for 'virtualbox' is outdated! Current: 7.7.15. Latest: 7.8.128 * 'oraclelinux/6' for 'virtualbox' is outdated! Current: 6.10.13. Latest: 6.10.127 * 'oraclelinux/6' for 'virtualbox' is outdated! Current: 6.8.3. Latest: 6.10.127
Another benefit of using catalog data to install Oracle Linux Vagrant boxes, is that checksums are automatically verified after download.
Vagrant Boxes for libvirt Provider
With the newly released boxes for the libvirt provider you can create Oracle Linux Vagrant environments using KVM as the hypervisor. In this blog post, Philippe explains how to get started.
Conclusion
In this blog post, I discussed changes we made to the way we publish Oracle Linux Vagrant boxes and showed how to use Vagrant box catalog data to install and manage box versions.
