-
Notifications
You must be signed in to change notification settings - Fork 7
/
Vagrantfile
59 lines (48 loc) · 1.88 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Specify Vagrant version and Vagrant API version
Vagrant.require_version ">= 1.6.0"
VAGRANTFILE_API_VERSION = "2"
# run this first:
# vagrant plugin install vagrant-vbguest
# vagrant plugin install vagrant-hostmanager
# Create and configure the VM(s)
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "geerlingguy/centos7"
# Skip checking for an updated Vagrant box
config.vm.box_check_update = false
config.vbguest.auto_update = false
config.hostmanager.enabled = true
config.hostmanager.manage_host = true
config.hostmanager.manage_guest = true
config.hostmanager.ignore_private_ip = false
config.hostmanager.include_offline = true
# Don't use Vagrant's default insecure key
config.ssh.insert_key = false
config.vm.provision "shell", path: "vagrant_bootstrap.sh"
config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.memory = 512
v.cpus = 1
v.customize [
"setextradata",
:id,
"VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root",
"1"
]
end
config.vm.define "manager" do |node|
node.vm.hostname = "manager"
node.vm.network :private_network, ip: "172.85.0.100"
node.vm.synced_folder ".", "/opt/swarmci", type: "rsync", owner: "vagrant", group: "vagrant",
rsync__args: ["--recursive", "--links", "--perms", "--times", "--delete", "--filter=:- .gitignore"]
end
config.vm.define "node1" do |node|
node.vm.hostname = "node1"
node.vm.network :private_network, ip: "172.85.0.101"
end
config.vm.define "node2" do |node|
node.vm.hostname = "node2"
node.vm.network :private_network, ip: "172.85.0.102"
end
end