Vagrantfile 1.75 KB
Newer Older
1 2
Vagrant.require_version ">= 1.5.3"

3 4
VAGRANTFILE_API_VERSION = "2"

5
MEMORY = 4096
6 7
CPU_COUNT = 2

8
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
9 10
  config.vm.box     = "precise64"
  config.vm.box_url = "http://files.vagrantup.com/precise64.box"
11
  config.ssh.insert_key = true
12
  config.vm.synced_folder  ".", "/vagrant", disabled: true
13 14 15 16 17 18 19
  config.vm.network :private_network, ip: "192.168.33.10"

  config.vm.provider :virtualbox do |vb|
    vb.customize ["modifyvm", :id, "--memory", MEMORY.to_s]

    # You can adjust this to the amount of CPUs your system has available
    vb.customize ["modifyvm", :id, "--cpus", CPU_COUNT.to_s]
20 21 22 23

    # Allow DNS to work for Ubuntu 12.10 host
    # http://askubuntu.com/questions/238040/how-do-i-fix-name-service-for-vagrant-client
    vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
24
  end
25

26 27 28 29 30 31 32 33
  ["vmware_fusion", "vmware_workstation"].each do |vmware_provider|
    config.vm.provider vmware_provider do |v, override|
      override.vm.box     = "precise64_vmware"
      override.vm.box_url = "http://files.vagrantup.com/precise64_vmware.box"
      v.vmx["memsize"] = MEMORY.to_s
      v.vmx["numvcpus"] = CPU_COUNT.to_s
    end
  end
34

35 36 37 38
  # Make LC_ALL default to en_US.UTF-8 instead of en_US.
  # See: https://github.com/mitchellh/vagrant/issues/1188
  config.vm.provision "shell", inline: 'echo \'LC_ALL="en_US.UTF-8"\' > /etc/default/locale'

39 40
  config.vm.provision :ansible do |ansible|
    # point Vagrant at the location of your playbook you want to run
41
    ansible.playbook = "../../../playbooks/vagrant-fullstack.yml"
42 43 44 45
    # set extra-vars here instead of in the vagrant play so that
    # they are written out to /edx/etc/server-vars.yml which can
    # be used later when running ansible locally
    ansible.verbose = "vvvv"
46 47
  end
end