Skip to main content

Command Palette

Search for a command to run...

🧩 Day 22 – Exploring Vagrant Plugins & Multi-Stage Vagrantfile Setups

How to Use Vagrant Plugins for Multi-Stage VM Setups

Published
β€’2 min read
🧩 Day 22 – Exploring Vagrant Plugins & Multi-Stage Vagrantfile Setups

Today’s DevOps learning focused on diving deeper into Vagrant β€” specifically exploring the powerful world of Vagrant plugins and how to create multi-stage environments using a Vagrantfile.


πŸ”Œ Vagrant Plugins – Extend the Power of Vagrant

Vagrant supports a wide range of community and official plugins that enhance its default behavior.

πŸ‘‰ Installing a Plugin:

vagrant plugin install <plugin-name>

πŸ” Example Plugins:

  • vagrant-disksize: Resize virtual machine disks

  • vagrant-vbguest: Auto-install VirtualBox Guest Additions

  • vagrant-libvirt: Use libvirt instead of VirtualBox as the provider

πŸ”§ Manage Plugins:

vagrant plugin list
vagrant plugin uninstall <plugin-name>

These plugins open up endless possibilities for customization and optimization of your VMs.


🧱 Multi-Stage Vagrantfile Structure

As setups grow complex, having multiple machines or configurations in a single Vagrantfile is essential.

βœ… Example: Two VMs in One Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.define "web" do |web|
    web.vm.box = "ubuntu/bionic64"
    web.vm.hostname = "webserver"
  end

  config.vm.define "db" do |db|
    db.vm.box = "ubuntu/bionic64"
    db.vm.hostname = "dbserver"
  end
end

You can run specific machines:

vagrant up web
vagrant up db

This is perfect for building multi-tier architectures (web + database, for example).


✨ Why This Matters

Combining plugins with multi-stage configurations allows you to:

  • Reuse infrastructure setups

  • Test different tools (e.g., Nginx vs Apache)

  • Simulate production-like setups locally


πŸ“Œ What’s Next?

Next, I’ll be learning basics of python along with json and yaml


πŸ“˜ This is part of my DevOps as a Beginner series – where I share my progress daily.
Thanks for reading – feel free to connect, ask questions, or follow along!

#DevOps #Vagrant #VagrantPlugins #Virtualization #HashiCorp #DevOpsBeginner #Linux #InfrastructureAsCode

DevOps overview as a beginner

Part 22 of 50

Sharing my journey of learning DevOps as a beginner β€” covering essential tools, cloud setup, CI/CD, Docker, monitoring, and more, step by step with practical examples.

Up next

🐍 Day 23 – Introduction to Python Lists, Tuples & Dictionaries

A Beginner's Guide to Python: Lists, Tuples, and Dictionaries