lavabit / robox

The tools needed to robotically create/configure/provision a large number of operating systems, for a variety of hypervisors, using packer.
626 stars 139 forks source link

Incorrect version check for 'ALT Linux' workaround Alpine Linux boxes #169

Closed agorgl closed 3 years ago

agorgl commented 3 years ago

In PR #76 the check for Vagrant version uses string comparison:

if Vagrant::VERSION < '2.2.6' && ...

instead of correct semantic version comparison as it should:

if Gem::Version.new(Vagrant::VERSION) < Gem::Version.new('2.2.6') && ...

resulting in both warning Setting OS type to 'ALT Linux' as a workaround appearing on VM creation, and private network creation failing with:

==> dockerhost: Setting hostname...
==> dockerhost: Configuring and enabling network interfaces...
==> dockerhost: Removing domain...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

/sbin/ifdown 'eth1'
mkdir -p '/etc/net/ifaces/eth1'
mv -f '/tmp/vagrant-network-entry-eth1-1603091775-0' '/etc/net/ifaces/eth1/options'
mv -f '/tmp/vagrant-network-ipv4-address-entry-eth1-1603091775-0' '/etc/net/ifaces/eth1/ipv4address'
mv -f '/tmp/vagrant-network-ipv4-route-entry-eth1-1603091775-0' '/etc/net/ifaces/eth1/ipv4route'
/sbin/ifup 'eth1'

Stdout from the command:

Stderr from the command:

ifdown: interface eth1 not configured
ifup: ignoring unknown interface eth1

when the Vagrant version is Vagrant 2.2.10

Problem confirmed with box 'generic/alpine312' version '3.0.36'

I tried the proposed fix locally in .vagrant.d/boxes/generic-VAGRANTSLASH-alpine312/3.0.36/libvirt/Vagrantfile and worked as it should. Please replace all the string comparisons introduced in PR #76 with correct semantic version comparisons.

ladar commented 3 years ago

This should be fixed with the 3.1.0 boxes.

timschumi commented 3 years ago

The issue seems fixed (i.e. I don't get that message anymore) in the upcoming 3.1.0 revision, at least in the generic/alpine311 box (which I have downloaded manually, since the version isn't fully released yet).