Skip to content

Instantly share code, notes, and snippets.

@naramdash
Last active October 17, 2021 15:56
Show Gist options
  • Save naramdash/ffdd1db88474d5fd3774b281460af655 to your computer and use it in GitHub Desktop.
Save naramdash/ffdd1db88474d5fd3774b281460af655 to your computer and use it in GitHub Desktop.
Vagrantfile sample
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.define "control-plane" do |config|
config.vm.box = "generic/rocky8"
config.vm.provider "virtualbox" do |vb|
vb.name = "control-plane"
vb.memory = "2048"
vb.cpus = "2"
end
config.vm.hostname = "control-plane.example.com"
config.vm.network "private_network", ip: "192.168.56.11"
end
config.vm.define "node1" do |config|
config.vm.box = "generic/rocky8"
config.vm.provider "virtualbox" do |vb|
vb.name = "node1"
vb.memory = "2048"
vb.cpus = "1"
end
config.vm.hostname = "node1.example.com"
config.vm.network "private_network", ip: "192.168.56.21"
# config.disksize.size = "51GB"
end
config.vm.define "node2" do |config|
config.vm.box = "generic/rocky8"
config.vm.provider "virtualbox" do |vb|
vb.name = "node2"
vb.memory = "2048"
vb.cpus = "1"
end
config.vm.hostname = "node2.example.com"
config.vm.network "private_network", ip: "192.168.56.22"
# config.disksize.size = "52GB"
end
config.vm.define "node3" do |config|
config.vm.box = "generic/rocky8"
config.vm.provider "virtualbox" do |vb|
vb.name = "node3"
vb.memory = "2048"
vb.cpus = "1"
end
config.vm.hostname = "node3.example.com"
config.vm.network "private_network", ip: "192.168.56.23"
# config.disksize.size = "53GB"
end
config.vm.define "node4" do |config|
config.vm.box = "generic/rocky8"
config.vm.provider "virtualbox" do |vb|
vb.name = "node4"
vb.memory = "2048"
vb.cpus = "1"
end
config.vm.hostname = "node4.example.com"
config.vm.network "private_network", ip: "192.168.56.24"
# config.disksize.size = "53GB"
end
config.hostmanager.enabled = true
config.hostmanager.manage_guest = true
# config.vm.provision "shell", inline: <<-SHELL
# sed -i 's/ChallengeResponseAuthentication no/ChallengeResponseAuthentication yes/g' /etc/ssh/sshd_config
# sed -i 's/archive.ubuntu.com/ftp.daum.net/g' /etc/apt/sources.list
# sed -i 's/security.ubuntu.com/ftp.daum.net/g' /etc/apt/sources.list
# systemctl restart ssh
# SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment