82 lines
2.4 KiB
Ruby
82 lines
2.4 KiB
Ruby
# -*- mode: ruby -*-
|
|
# vi: set ft=ruby :
|
|
|
|
Vagrant.configure("2") do |config|
|
|
# Base VM OS configuration.
|
|
config.vm.box = "debian/bullseye64"
|
|
config.ssh.insert_key = false
|
|
config.vm.synced_folder '.', '/vagrant', disabled: true
|
|
|
|
# General VirtualBox VM configuration.
|
|
config.vm.provider :virtualbox do |v|
|
|
v.memory = 512
|
|
v.cpus = 1
|
|
v.linked_clone = true
|
|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
|
|
v.customize ["modifyvm", :id, "--ioapic", "on"]
|
|
end
|
|
|
|
# lb HAproxy.
|
|
config.vm.define "lb" do |lb|
|
|
lb.vm.hostname = "lb.test"
|
|
lb.vm.network :private_network, ip: "192.168.56.2"
|
|
lb.vm.provision "shell",
|
|
inline: "sudo apt-get update ; sudo apt-get install -y vim curl wget"
|
|
lb.vm.provision "ansible" do |ansible|
|
|
ansible.playbook = "provision/setup-lb.yml"
|
|
end
|
|
end
|
|
|
|
# NFS.
|
|
config.vm.define "nfs" do |nfs|
|
|
nfs.vm.hostname = "nfs.test"
|
|
nfs.vm.network :private_network, ip: "192.168.56.6"
|
|
nfs.vm.provision "shell",
|
|
inline: "sudo apt-get update ; sudo apt-get install -y vim curl wget"
|
|
nfs.vm.provision "ansible" do |ansible|
|
|
ansible.playbook = "provision/setup-nfs.yml"
|
|
end
|
|
end
|
|
|
|
# MySQL.
|
|
config.vm.define "db" do |db|
|
|
db.vm.hostname = "db.test"
|
|
db.vm.network :private_network, ip: "192.168.56.5"
|
|
db.vm.provision "shell",
|
|
inline: "sudo apt-get update ; sudo apt-get install -y vim curl wget"
|
|
db.vm.provision "ansible" do |ansible|
|
|
ansible.playbook = "provision/setup-db.yml"
|
|
end
|
|
end
|
|
|
|
# Apache web1.
|
|
config.vm.define "web1" do |web1|
|
|
web1.vm.hostname = "web1.test"
|
|
web1.vm.network :private_network, ip: "192.168.56.3"
|
|
web1.vm.provider :virtualbox do |v|
|
|
v.customize ["modifyvm", :id, "--memory", 512]
|
|
end
|
|
web1.vm.provision "shell",
|
|
inline: "sudo apt-get update ; sudo apt-get install -y vim curl wget"
|
|
web1.vm.provision "ansible" do |ansible|
|
|
ansible.playbook = "provision/setup-web.yml"
|
|
end
|
|
end
|
|
|
|
# Apachei web2.
|
|
config.vm.define "web2" do |web2|
|
|
web2.vm.hostname = "web2.test"
|
|
web2.vm.network :private_network, ip: "192.168.56.4"
|
|
web2.vm.provider :virtualbox do |v|
|
|
v.customize ["modifyvm", :id, "--memory", 512]
|
|
end
|
|
web2.vm.provision "shell",
|
|
inline: "sudo apt-get update ; sudo apt-get install -y vim curl wget"
|
|
web2.vm.provision "ansible" do |ansible|
|
|
ansible.playbook = "provision/setup-web.yml"
|
|
end
|
|
end
|
|
|
|
end
|
|
|