forked from ccollicutt/swiftacular
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Vagrantfile
57 lines (44 loc) · 1.77 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
nodes = {
'swift-package-cache' => [1, 20],
'swift-keystone' => [1, 50],
# 'swift-lbssl' => [1, 30],
'swift-proxy' => [1, 100],
'swift-storage' => [3, 200],
'grafana' => [1, 150],
}
Vagrant.configure("2") do |config|
config.vm.provider :libvirt do |libvirt|
libvirt.qemu_use_session = false
# if the above doesn't work, try uncommenting the following instead
#libvirt.uri = 'qemu:///system'
end
end
Vagrant.configure("2") do |config|
config.vm.box = "eurolinux-vagrant/centos-stream-9"
config.vm.box_url = "https://app.vagrantup.com/eurolinux-vagrant/boxes/centos-stream-9/versions/9.0.28/providers/libvirt.box"
nodes.each do |prefix, (count, ip_start)|
count.times do |i|
hostname = "%s-%02d" % [prefix, (i+1)]
config.vm.provider :libvirt do |v|
v.memory = 3072
end
config.vm.define "#{hostname}" do |box|
puts "working on #{hostname} with ip of 192.168.100.#{ip_start+i}"
box.vm.hostname = "#{hostname}.example.com"
#
# Networks
#
# Public
box.vm.network :private_network, :ip => "192.168.100.#{ip_start+i}", :netmask => "255.255.255.0"
# SSL and loadbalancing
box.vm.network :private_network, :ip => "10.0.10.#{ip_start+i}", :netmask => "255.255.255.0"
# Internal
box.vm.network :private_network, :ip => "10.0.20.#{ip_start+i}", :netmask => "255.255.255.0"
# Replication
box.vm.network :private_network, :ip => "10.0.30.#{ip_start+i}", :netmask => "255.255.255.0"
end
end
end
end