We will use local environment with Vagrant and VirtualBox to test best practices.
Requirement
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/focal64"
# Configuration for the first virtual machine
config.vm.define "machine1" do |machine1|
machine1.vm.network "private_network", ip: "192.168.33.100"
machine1.vm.hostname = "linux-server"
machine1.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
end
machine1.vm.synced_folder "./datas", "/vagrant_data"
end
# Configuration for the second virtual machine
config.vm.define "machine2" do |machine2|
machine2.vm.network "private_network", ip: "192.168.33.110"
machine2.vm.hostname = "jenkins-server"
machine2.vm.provider "virtualbox" do |vb|
vb.memory = "5120"
end
machine2.vm.synced_folder "./datas", "/vagrant_data"
end
# Configuration for the third virtual machine
config.vm.define "machine3" do |machine3|
machine3.vm.network "private_network", ip: "192.168.33.120"
machine3.vm.hostname = "monitor-server"
machine3.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
end
machine3.vm.synced_folder "./datas", "/vagrant_data"
machine3.vm.provision "shell", inline: <<-SHELL
apt-get update
SHELL
end
end
Installation
vagrant up
vagrant status
vagrant ssh
vagrant halt