github.com/chalford/terraform@v0.3.7-0.20150113080010-a78c69a8c81f/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  # Install Go and prerequisites
     9  apt-get -qq update
    10  apt-get -qq install build-essential curl git-core libpcre3-dev mercurial pkg-config zip
    11  hg clone -u release https://code.google.com/p/go /opt/go
    12  cd /opt/go/src && ./all.bash
    13  
    14  # Setup the GOPATH
    15  mkdir -p /opt/gopath
    16  cat <<EOF >/etc/profile.d/gopath.sh
    17  export GOPATH="/opt/gopath"
    18  export PATH="/opt/go/bin:\$GOPATH/bin:\$PATH"
    19  EOF
    20  
    21  # Make sure the GOPATH is usable by vagrant
    22  chown -R vagrant:vagrant /opt/go
    23  chown -R vagrant:vagrant /opt/gopath
    24  SCRIPT
    25  
    26  Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    27    config.vm.box = "chef/ubuntu-12.04"
    28  
    29    config.vm.provision "shell", inline: $script
    30  
    31    ["vmware_fusion", "vmware_workstation"].each do |p|
    32      config.vm.provider "p" do |v|
    33        v.vmx["memsize"] = "2048"
    34        v.vmx["numvcpus"] = "2"
    35        v.vmx["cpuid.coresPerSocket"] = "1"
    36      end
    37    end
    38  end