forked from erlong15/otus-gluster
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathVagrantfile
More file actions
64 lines (56 loc) · 1.67 KB
/
Vagrantfile
File metadata and controls
64 lines (56 loc) · 1.67 KB
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
#
# export VAGRANT_EXPERIMENTAL="disks"
Vagrant.configure("2") do |config|
# Base VM OS configuration.
config.vm.box = "alma/9.3"
config.vm.synced_folder '.', '/vagrant', disabled: false
config.ssh.insert_key = false
config.vm.provider :virtualbox do |v|
v.memory = 1024
v.cpus = 1
end
# Define two VMs with static private IP addresses.
boxes = [
{ :name => "gluster1",
:ip => "192.168.7.151",
},
{ :name => "gluster2",
:ip => "192.168.7.152",
},
{ :name => "gluster3",
:ip => "192.168.7.153",
},
{ :name => "gluster4",
:ip => "192.168.7.154",
}
]
# Provision each of the VMs.
boxes.each do |opts|
config.vm.define opts[:name] do |config|
config.vm.hostname = opts[:name]
config.vm.network "private_network", ip: opts[:ip]
config.vm.disk :disk, size: "512MB", name: "disk1"
config.vm.disk :disk, size: "512MB", name: "disk2"
config.vm.disk :disk, size: "512MB", name: "disk3"
config.vm.disk :disk, size: "512MB", name: "disk4"
config.vm.disk :disk, size: "512MB", name: "disk5"
config.vm.provision "shell",
name: "Setup glusterfs",
path: "install_gluster.sh"
end
end
# Comment strings below and install Ansible to the host gluster1
# Provision VMs using Ansible after the last VM is booted.
# if opts[:name] == boxes.last[:name]
# config.vm.provision "ansible" do |ansible|
# ansible.playbook = "playbooks/provision.yml"
# ansible.inventory_path = "inventory"
# ansible.limit = "all"
# end
# end
# Block end
#end
#end
end