From 4fc0a1ea0a0ec1aef32866e776c493a7388ac69e Mon Sep 17 00:00:00 2001 From: James Nugent Date: Thu, 2 Nov 2017 10:45:31 -0700 Subject: [PATCH] build: Allow multi-platform dev with Vagrantfile This commit rewrites the Vagrantfile for Packer in a similar manner to the work done for Nomad (hashicorp/nomad#3175) in order to make cross-platform development easier. It also adds support for a FreeBSD base box. Provisioning scripts are separated out in order that they can be correctly linted. Each script is prefixed `vagrant`, then the operating system, then whether or not it expects to be run in a privileged shell. Finally, dependencies have been bumped - Go 1.6 is switched out for the latest (1.9.2). --- Vagrantfile | 121 +++++++++++++------- scripts/vagrant-freebsd-priv-config.sh | 35 ++++++ scripts/vagrant-freebsd-unpriv-bootstrap.sh | 8 ++ scripts/vagrant-linux-priv-config.sh | 19 +++ scripts/vagrant-linux-priv-go.sh | 42 +++++++ scripts/vagrant-linux-unpriv-bootstrap.sh | 3 + 6 files changed, 187 insertions(+), 41 deletions(-) create mode 100755 scripts/vagrant-freebsd-priv-config.sh create mode 100755 scripts/vagrant-freebsd-unpriv-bootstrap.sh create mode 100755 scripts/vagrant-linux-priv-config.sh create mode 100755 scripts/vagrant-linux-priv-go.sh create mode 100755 scripts/vagrant-linux-unpriv-bootstrap.sh diff --git a/Vagrantfile b/Vagrantfile index b61b3d209..30b0437ba 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,50 +1,89 @@ # -*- mode: ruby -*- # vi: set ft=ruby : -$script = <