forked from qianlifu12345/flat-network-env
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
75 lines (60 loc) · 2.54 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
74
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
#
$install_docker = <<INSTALL_DOCKER
echo Installing docker
curl -sSL https://get.docker.com | sed 's/apt-get install -y -q docker-engine/apt-get install -y -q docker-engine=1.12.3-0~trusty/g' | sh -
#curl -sSL https://get.docker.com | sh -
sudo usermod -aG docker vagrant
INSTALL_DOCKER
#$install_rancher_server = <<INSTALL_RANCHER_SERVER
#echo Installing Rancher Server
#sudo docker run -d --restart=always -p 8080:8080 rancher/server
#INSTALL_RANCHER_SERVER
Vagrant.configure(2) do |config|
config.vm.provision "shell", inline: $install_docker
config.vm.synced_folder "/Users/qian_lifu", "/lifuqian"
config.vm.define "cattleh1" do |cattleh1|
cattleh1.vm.hostname = 'cattleh1'
cattleh1.vm.box= "ubuntu/trusty64"
cattleh1.vm.box_url = "ubuntu/trusty64"
cattleh1.vm.network :private_network, ip: "172.22.101.101",
nic_type: "82545EM"
cattleh1.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--memory", 2048]
v.customize ["modifyvm", :id, "--name", "cattleh1"]
v.customize ["modifyvm", :id, "--nicpromisc2", "allow-vms"]
end
end
config.vm.define "cattleh2" do |cattleh2|
cattleh2.vm.hostname = 'cattleh2'
cattleh2.vm.box= "ubuntu/trusty64"
cattleh2.vm.box_url = "ubuntu/trusty64"
cattleh2.vm.network :private_network, ip: "172.22.101.102",
nic_type: "82545EM"
cattleh2.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--memory", 2048]
v.customize ["modifyvm", :id, "--name", "cattleh2"]
v.customize ["modifyvm", :id, "--nicpromisc2", "allow-vms"]
end
end
# config.vm.define "cattleh3" do |cattleh3|
# cattleh3.vm.hostname = 'cattleh3'exit
# cattleh3.vm.box= "ubuntu/trusty64"
# cattleh3.vm.box_url = "ubuntu/trusty64"
# cattleh3.vm.network :private_network, ip: "172.22.101.103",
# nic_type: "82545EM"
# cattleh3.vm.provider :virtualbox do |v|
# v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
# v.customize ["modifyvm", :id, "--memory", 2048]
# v.customize ["modifyvm", :id, "--name", "cattleh3"]
# v.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"]
# end
# end
end