-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVagrantfile
54 lines (51 loc) · 1.99 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "bento/centos-7.1"
(1..2).each do |i|
config.vm.define vm_name = "server-#{i}" do |config|
config.cache.scope = :box
config.vm.hostname = vm_name
file_to_disk = "./tmp/server_disk-#{i}.vdi"
config.vm.provider "virtualbox" do | v |
unless File.exist?(file_to_disk)
v.customize ['createhd', '--filename', file_to_disk, '--size', 10 * 1024]
end
v.customize ['storageattach', :id, '--storagectl','SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk]
end
serviceIP = "172.21.11.#{i+10}"
storageIP = "172.21.12.#{i+10}"
config.vm.network :private_network, ip: serviceIP
config.vm.network :private_network, ip: storageIP
#config.vm.provision "shell", path: "deploy_script/deploy_mount_disk.sh"
#config.vm.provision "shell", path: "deploy_script/deploy_package.sh"
#config.vm.provision "shell", path: "deploy_script/glusterdstart.sh"
end
end
config.vm.define vm_name = "client" do |config|
config.cache.scope = :box
config.vm.hostname = vm_name
serviceIP = "172.21.11.10"
#storageIP = "172.21.12.10"
config.vm.network :private_network, ip: serviceIP
#config.vm.network :private_network, ip: storageIP
#config.vm.provision "shell", path: "deploy_script/deploy_package.sh"
end
config.vm.define vm_name = "client2" do |config|
config.cache.scope = :box
config.vm.hostname = vm_name
serviceIP = "172.21.11.101"
#storageIP = "172.21.12.10"
config.vm.network :private_network, ip: serviceIP
#config.vm.network :private_network, ip: storageIP
config.vm.provision "shell", path: "deploy_script/deploy_package.sh"
end
# config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# end
#
end