-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVagrantfile
executable file
·45 lines (32 loc) · 1.4 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'yaml'
# Load up our vagrant config files -- vagrantconfig.yml first
_config = YAML.load(File.open(File.join(File.dirname(__FILE__), "vagrantconfig.yml"), File::RDONLY).read)
CONF = _config
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.hostname = CONF["name"]
config.vm.network "private_network", ip: CONF["ipaddress"]
config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"
config.ssh.forward_agent = true
unless Vagrant.has_plugin?("vagrant-hostsupdater")
raise 'vagrant-hostsupdater plugin not installed, run "vagrant plugin install vagrant-hostsupdater"'
end
config.hostsupdater.remove_on_suspend = true
config.hostsupdater.aliases = [
CONF["name"],
]
config.vm.synced_folder "./", "/var/www", type: "nfs", mount_options: ['rw', 'nolock', 'vers=3', 'tcp', 'fsc', 'actimeo=1']
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", CONF["ram"]]
vb.customize ["modifyvm", :id, "--cpus", CONF["cpus"]]
end
config.vm.provider "vmware_fusion" do |v|
v.vmx["memsize"] = CONF["ram"]
v.vmx["numvcpus"] = CONF["cpus"]
end
config.vm.provision :shell, :path => "scripts/install-ansible.sh", :args => "/var/www"
config.vm.provision :shell, :path => "scripts/run-ansible.sh", :args => "/var/www"
end