This repository has been archived by the owner on Oct 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
73 lines (63 loc) · 2.08 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# -*- mode: ruby -*-
# vi: set ft=ruby :
projectname = File.basename(Dir.getwd)
module OS
def OS.windows?
(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
end
def OS.mac?
(/darwin/ =~ RUBY_PLATFORM) != nil
end
def OS.unix?
!OS.windows?
end
def OS.linux?
OS.unix? and not OS.mac?
end
end
Vagrant.configure("2") do |config|
#config.ssh.insert_key = false
config.ssh.forward_agent = true
config.vm.box = "bento/ubuntu-16.04"
config.vm.network :private_network, ip: "33.33.33.10"
config.vm.hostname = projectname
#config.vm.synced_folder "./www", "/home/vagrant/www", create: true
config.vm.provider "virtualbox" do |vb|
vb.name = projectname
vb.customize ["modifyvm", :id, "--cpus", 2]
vb.customize ["modifyvm", :id, "--ioapic", "on"]
vb.customize ["modifyvm", :id, "--memory", 2048]
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
vb.customize ["modifyvm", :id, "--paravirtprovider", "kvm"]
vb.customize ["modifyvm", :id, "--pae", "on"]
vb.customize ["modifyvm", :id, "--ostype", "Ubuntu_64"]
vb.customize ["modifyvm", :id, "--vram", 10]
# Linked Clones see https://www.vagrantup.com/docs/virtualbox/configuration.html#linked-clones
vb.linked_clone = true if Gem::Version.new(Vagrant::VERSION) >= Gem::Version.new('1.8.0')
end
config.vm.provider 'parallels' do |prl, override|
prl.name = projectname
prl.update_guest_tools = true
prl.cpus = 2
prl.memory = 2048
end
# bento images are not set to UTF-8
config.vm.provision :shell, :inline => <<-EOT
update-locale LANG=en_US.UTF-8
update-locale LC_ALL="en_US.UTF-8
update-locale LC_CTYPE="en_US.UTF-8
EOT
if OS.windows?
config.vm.provision "ansible_local" do |ansible|
ansible.playbook = "ansible/playbook.yml"
ansible.inventory_path = "ansible-inventory"
ansible.limit = "ansible_local"
end
else
config.vm.provision "ansible" do |ansible|
ansible.playbook = "ansible/playbook.yml"
ansible.inventory_path = "ansible-inventory"
ansible.limit = "vagrant"
end
end
end