-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathVagrantfile
45 lines (44 loc) · 1.57 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 :
Vagrant.configure(2) do |config|
if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
config.vm.synced_folder ".", "/vagrant", mount_options: ["dmode=700,fmode=600"]
else
config.vm.synced_folder ".", "/vagrant"
end
config.vm.define "proxy" do |d|
d.vm.box = "ubuntu/trusty64"
d.vm.hostname = "proxy"
d.vm.network "private_network", ip: "10.100.198.200"
d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/proxy.yml -i /vagrant/ansible/hosts/prod"
d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /vagrant/ansible/swarm.yml -i /vagrant/ansible/hosts/prod"
d.vm.provider "virtualbox" do |v|
v.memory = 1024
v.linked_clone = true if Vagrant::VERSION =~ /^1.8/
end
end
config.vm.define "master" do |d|
d.vm.box = "ubuntu/trusty64"
d.vm.hostname = "master"
d.vm.network "private_network", ip: "10.100.192.200"
d.vm.provider "virtualbox" do |v|
v.memory = 1024
v.linked_clone = true if Vagrant::VERSION =~ /^1.8/
end
end
(1..2).each do |i|
config.vm.define "node-#{i}" do |d|
d.vm.box = "ubuntu/trusty64"
d.vm.hostname = "node-#{i}"
d.vm.network "private_network", ip: "10.100.192.20#{i}"
d.vm.provider "virtualbox" do |v|
v.memory = 1024
v.linked_clone = true if Vagrant::VERSION =~ /^1.8/
end
end
end
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :box
end
end