Created
March 4, 2024 05:40
-
-
Save sampathshivakumar/1264b7dc47e5c909708661fa01a015da to your computer and use it in GitHub Desktop.
this vagrant file create two servers one is centos and another ubuntu with 1Gb memory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Linux for DevOps Lab Setup | |
$setup_lab = <<SCRIPT | |
# Enable root login in ssh configuration | |
sed -i "s/^PermitRootLogin no/PermitRootLogin yes/g" /etc/ssh/sshd_config | |
sed -i "s/^PasswordAuthentication no/PasswordAuthentication yes/g" /etc/ssh/sshd_config | |
systemctl restart sshd | |
SCRIPT | |
Vagrant.configure("2") do |config| | |
config.vm.define "centos" do |subconfig| | |
subconfig.vm.box = "boxomatic/centos-stream-9" | |
subconfig.vm.hostname = "centos" | |
subconfig.vm.network "private_network", ip: "192.168.2.10" | |
subconfig.vm.provision "shell", inline:$setup_lab | |
subconfig.vm.provider "virtualbox" do |vb| | |
vb.memory = "1024" | |
end | |
end | |
config.vm.define "ubuntu" do |subconfig| | |
subconfig.vm.box = "ubuntu/jammy64" | |
subconfig.vm.hostname = "ubuntu" | |
subconfig.vm.network "private_network", ip: "192.168.2.20" | |
subconfig.vm.provision "shell", inline:$setup_lab | |
subconfig.vm.provider "virtualbox" do |vb| | |
vb.memory = "1024" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment