From 5f824e3bfd36a0bb2666d5b384daa6b276d2f99c Mon Sep 17 00:00:00 2001 From: Michael Bridgen Date: Tue, 14 Oct 2014 18:45:22 +0100 Subject: [PATCH 1/2] Added minimal vagrantfile This makes an Ubuntu-based vagrant image that has - docker installed - go tools installed - weave dependencies installed - $GOPATH set to ~ - the local working directory mapped as a synced folder into the right place in $GOPATH So one should be able to $ vagrant up $ vagrant ssh vagrant$ cd src/github.com/zettio/weave vagrant$ make -C weaver --- Vagrantfile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Vagrantfile diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 00000000..0f908c0b --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,23 @@ +VAGRANTFILE_API_VERSION = "2" + +vm_ip = "172.16.0.3" # arbitrary private IP +pkgs = "docker.io golang ethtool libpcap-dev git mercurial" + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + config.vm.box = "phusion/ubuntu-14.04-amd64" + config.vm.box_url = "https://oss-binaries.phusionpassenger.com/vagrant/boxes/latest/ubuntu-14.04-amd64-vbox.box" + + config.vm.network "private_network", ip: vm_ip + + config.vm.synced_folder "./", "/home/vagrant/src/github.com/zettio/weave" + + pkg_cmd = "apt-get update -qq; " \ + "apt-get install -q -y --force-yes --no-install-recommends " + pkg_cmd << pkgs + config.vm.provision :shell, :inline => pkg_cmd + config.vm.provision :shell, :inline => "usermod -a -G docker vagrant; " + config.vm.provision :shell, :inline => "echo export GOPATH=/home/vagrant >> /home/vagrant/.bashrc" + config.vm.provision :shell, :inline => "chown -R vagrant:vagrant /home/vagrant/src" + config.vm.provision :shell, :inline => "sudo go install -a -tags netgo std" + +end From 4c7fb5ce91d4317bdc5fb819504bce9604cc83a0 Mon Sep 17 00:00:00 2001 From: Michael Bridgen Date: Wed, 15 Oct 2014 00:32:06 +0100 Subject: [PATCH 2/2] Added hook for local vagrant config If there's a file Vagrantfile.local, run that too. This can be used to e.g., add the weavedns directory as a synced folder too. --- Vagrantfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index 0f908c0b..303cdfb1 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -21,3 +21,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.provision :shell, :inline => "sudo go install -a -tags netgo std" end + +begin + load 'Vagrantfile.local' +rescue LoadError +end