Background
For the past year a colleague and I have been running in an application
inside a FreeBSD-11 VM (virtualbox) sitting on a FreeBSD host. We put
in considerable time and effort writing a Vagrantfile that would
provision the VM with dozens of FreeBSD packages and Perl modules from
CPAN. Once we had the configuration we wanted, we left the Vagrantfile
and only needed to run 'vagrant up', 'vagrant reload --provision' or
'vagrant provision' a handful of times over a 12-month period.
Current Problem
We now want to update our application and run it on FreeBSD-12. With a
certain amount of effort we managed to install the VM and provision it
with a Vagrantfile very similar to the one we used in our FreeBSD-11 VM.
So we've already got many packages and Perl modules installed in the VM.
But now we want to add a few FreeBSD packages to the provisions. We are
finding that when we *re-run* 'vagrant provision' (or similar commands
that effect provisioning), we are fairly consistently failing with this
message:
#####
$ vagrant provision
==> default: Running provisioner: shell...
default: Running: inline script
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
#####
As a diagnostic, I completely gutted the shell script inside the
Vagrantfile that was doing the provisioning.
#####
$ cat Vagrantfile.diagnostic
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.box = "freebsd/FreeBSD-12.0-RELEASE"
# 2019-06-09 19:04:00
config.vm.synced_folder ".", "/vagrant", disabled: true
# 2019-05-22 10:00:00
# per
https://forums.freebsd.org/threads/official-vagrant-freebsd-images.52717/
config.vm.base_mac = "080027D14C66"
# 2019-06-09 18:43:00
# First attempt at configuring with same packages
# used in perl-reporter-03 during 5.29 dev cycle
config.vm.provision "shell", inline: <<-SHELL
SHELL
end
#####
But now, whenever I get to 'config.vm.provision "shell", inline:
<<-SHELL' the shell script apparently exits non-zero and I get the error
message cited above. I've also tried:
#####
config.vm.provision "shell", inline: <<-SHELL
true
SHELL
#####
... and ...
#####
config.vm.provision "shell", inline: <<-SHELL
exit 0
SHELL
#####
... land in each case gotten the same error message.
I should note that these command failures are *not* preventing us from
entering the VM. 'vagrant ssh' works.
Summary
Why is this shell script used inside a Vagrantfile apparently exiting
non-zero today when it was working fine just two days ago?
Thank you very much.
Jim Keenan