github.com/bendemaree/terraform@v0.5.4-0.20150613200311-f50d97d6eee6/Vagrantfile (about) 1 # -*- mode: ruby -*- 2 # vi: set ft=ruby : 3 4 # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! 5 VAGRANTFILE_API_VERSION = "2" 6 7 $script = <<SCRIPT 8 SRCROOT="/opt/go" 9 SRCPATH="/opt/gopath" 10 11 # Get the ARCH 12 ARCH=`uname -m | sed 's|i686|386|' | sed 's|x86_64|amd64|'` 13 14 # Install Prereq Packages 15 sudo apt-get update 16 sudo apt-get install -y build-essential curl git-core libpcre3-dev mercurial pkg-config zip 17 18 # Install Go 19 cd /tmp 20 wget -q https://storage.googleapis.com/golang/go1.4.2.linux-${ARCH}.tar.gz 21 tar -xf go1.4.2.linux-${ARCH}.tar.gz 22 sudo mv go $SRCROOT 23 sudo chmod 775 $SRCROOT 24 sudo chown vagrant:vagrant $SRCROOT 25 26 # Setup the GOPATH; even though the shared folder spec gives the working 27 # directory the right user/group, we need to set it properly on the 28 # parent path to allow subsequent "go get" commands to work. 29 sudo mkdir -p $SRCPATH 30 sudo chown -R vagrant:vagrant $SRCPATH 2>/dev/null || true 31 # ^^ silencing errors here because we expect this to fail for the shared folder 32 33 cat <<EOF >/tmp/gopath.sh 34 export GOPATH="$SRCPATH" 35 export GOROOT="$SRCROOT" 36 export PATH="$SRCROOT/bin:$SRCPATH/bin:\$PATH" 37 EOF 38 sudo mv /tmp/gopath.sh /etc/profile.d/gopath.sh 39 sudo chmod 0755 /etc/profile.d/gopath.sh 40 source /etc/profile.d/gopath.sh 41 SCRIPT 42 43 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 44 config.vm.box = "chef/ubuntu-12.04" 45 46 config.vm.provision "shell", inline: $script, privileged: false 47 config.vm.synced_folder '.', '/opt/gopath/src/github.com/hashicorp/terraform' 48 49 ["vmware_fusion", "vmware_workstation"].each do |p| 50 config.vm.provider p do |v| 51 v.vmx["memsize"] = "4096" 52 v.vmx["numvcpus"] = "4" 53 v.vmx['cpuid.coresPerSocket'] = '2' 54 end 55 end 56 end