Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  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.  
  8. Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  9. # All Vagrant configuration is done here. The most common configuration
  10. # options are documented and commented below. For a complete reference,
  11. # please see the online documentation at vagrantup.com.
  12.  
  13. # Every Vagrant virtual environment requires a box to build off of.
  14. config.vm.box = "centos-65-x64"
  15.  
  16. # Disable automatic box update checking. If you disable this, then
  17. # boxes will only be checked for updates when the user runs
  18. # `vagrant box outdated`. This is not recommended.
  19. # config.vm.box_check_update = false
  20.  
  21. # Create a forwarded port mapping which allows access to a specific port
  22. # within the machine from a port on the host machine. In the example below,
  23. # accessing "localhost:8080" will access port 80 on the guest machine.
  24. # config.vm.network "forwarded_port", guest: 80, host: 8080
  25.  
  26.  
  27. # Create a private network, which allows host-only access to the machine
  28. # using a specific IP.
  29. config.vm.network "private_network", ip: "192.168.33.10"
  30.  
  31. # Create a public network, which generally matched to bridged network.
  32. # Bridged networks make the machine appear as another physical device on
  33. # your network.
  34. # config.vm.network "public_network"
  35.  
  36. # If true, then any SSH connections made will enable agent forwarding.
  37. # Default value: false
  38. config.ssh.forward_agent = true
  39.  
  40. # Share an additional folder to the guest VM. The first argument is
  41. # the path on the host to the actual folder. The second argument is
  42. # the path on the guest to mount the folder. And the optional third
  43. # argument is a set of non-required options.
  44. # config.vm.synced_folder "../data", "/vagrant_data"
  45. config.vm.synced_folder ".", "/vagrant", nfs: true
  46.  
  47.  
  48. # Provider-specific configuration so you can fine-tune various
  49. # backing providers for Vagrant. These expose provider-specific options.
  50. # Example for VirtualBox:
  51. #
  52. config.vm.provider "virtualbox" do |vb|
  53. # # Don't boot with headless mode
  54. # vb.gui = true
  55. #
  56. # Use VBoxManage to customize the VM. For example to change memory:
  57. vb.customize ["modifyvm", :id, "--memory", "2048"]
  58.  
  59. host = RbConfig::CONFIG['host_os']
  60.  
  61. if host =~ /darwin/
  62. cpus = `sysctl -n hw.ncpu`.to_i
  63. elsif host =~ /linux/
  64. cpus = `nproc`.to_i
  65. else
  66. cpus = 1
  67. end
  68.  
  69. v.customize ["modifyvm", :id, "--cpus", cpus]
  70. end
  71.  
  72. config.vm.provision "shell", inline: "sudo yum install -y java-1.7.0-openjdk-devel git wget"
  73.  
  74. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement