520fef57a1314f7583ff44c223beb7561669fe21
Bare Bones Vagrant Setup
A ultra-lightweight Vagrant setup with 4 machines and a host for basic testing and development.
⚡ Ultra-Lightweight Features
- 512MB RAM per machine - Minimal memory footprint
- Debian Linux base - ~150MB base image, ~400MB with tools
- No provisioning scripts - Pure Debian base
- No shared folders - Disabled for performance
- Minimal network - Just basic connectivity
- Fast startup - Debian boots quickly
🏗️ Architecture
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ host │ │ machine1 │ │ machine2 │ │ machine3 │
│ 192.168.56.1│ │192.168.56.10│ │192.168.56.11│ │192.168.56.12│
│ │ │ │ │ │ │ │
│ - Host │ │ - Machine 1 │ │ - Machine 2 │ │ - Machine 3 │
│ - Gateway │ │ - Debian │ │ - Debian │ │ - Debian │
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
│
┌─────────────┐
│ machine4 │
│192.168.56.13│
│ │
│ - Machine 4 │
│ - Debian │
└─────────────┘
📋 Prerequisites
- Vagrant 2.2+
- VirtualBox 6.0+ or libvirt (KVM)
- 3GB+ RAM (512MB per machine)
- 4GB+ free disk space
🚀 Quick Start
-
Start all machines:
make start -
Check status:
make status -
Access a machine:
make ssh-host make ssh-machine1
🎛️ Management Commands
Using Make
make start # Start all machines
make stop # Stop all machines
make destroy # Destroy all machines
make status # Show machine status
make ssh-host # Access host machine
make ssh-machine1 # Access machine1
make ssh-machine2 # Access machine2
make ssh-machine3 # Access machine3
make ssh-machine4 # Access machine4
Using Management Script
./manage.sh start # Start all machines
./manage.sh stop # Stop all machines
./manage.sh destroy # Destroy all machines
./manage.sh status # Show machine status
./manage.sh ssh host # Access host machine
./manage.sh ssh machine1 # Access machine1
Using Vagrant Directly
vagrant up # Start all machines
vagrant halt # Stop all machines
vagrant destroy -f # Destroy all machines
vagrant status # Show machine status
vagrant ssh host # Access host machine
vagrant ssh machine1 # Access machine1
🌐 Network Configuration
- Host: 192.168.56.1
- Machine 1: 192.168.56.10
- Machine 2: 192.168.56.11
- Machine 3: 192.168.56.12
- Machine 4: 192.168.56.13
All machines are connected via a private network and can communicate with each other.
🔧 Machine Specifications
- OS: Debian 11 (Bullseye)
- RAM: 512MB per machine + 1GB swap
- CPU: 1 core per machine
- Disk: 8GB per machine
📁 Project Structure
test-vagrant/
├── Vagrantfile # Debian Linux cluster configuration
├── manage.sh # Management script
├── Makefile # Make targets
├── inventory # Ansible inventory file
├── setup-playbook.yml # Setup playbook (dependencies, Python, swap)
├── deploy-playbook.yml # Deployment playbook (apps, services)
├── README.md # This file
└── .gitignore # Git ignore rules
🛠️ Troubleshooting
Common Issues
-
Machines not starting:
vagrant status vagrant up --debug -
Network issues:
vagrant ssh host -c "ping 192.168.56.10" -
SSH issues:
vagrant ssh-config
Useful Commands
# Check machine status
vagrant status
# View machine details
vagrant ssh-config
# Reload machines
vagrant reload
# Provision machines
vagrant provision
🐧 Debian Linux Notes
Package Management
# Update package index
apt update
# Install packages
apt install package-name
# Search packages
apt search keyword
Common Debian Commands
# Check system info
uname -a
cat /etc/os-release
# Check memory usage
free -m
# Check disk usage
df -h
🎭 Ansible Integration
Prerequisites
# Install Ansible (on your host machine)
pip install ansible
# Or on Ubuntu/Debian
sudo apt install ansible
Ansible Commands
# Test connectivity to all hosts
make ansible-ping
# Install dependencies (Python, tools, swap)
make ansible-setup
# Deploy applications and services
make ansible-deploy
# List all hosts
make ansible-list
# Gather system facts
make ansible-facts
Using Management Script
# Test Ansible connectivity
./manage.sh ansible ping
# Install dependencies
./manage.sh ansible setup
# Deploy applications
./manage.sh ansible deploy
Direct Ansible Commands
# Test connectivity
ansible all -i inventory -m ping
# Run setup playbook
ansible-playbook -i inventory setup-playbook.yml
# Run deployment playbook
ansible-playbook -i inventory deploy-playbook.yml
# Run on specific hosts
ansible-playbook -i inventory deploy-playbook.yml --limit machines
# Run with verbose output
ansible-playbook -i inventory deploy-playbook.yml -v
🚀 Next Steps
This is a bare-bones Debian setup. You can extend it by:
- Adding provisioning scripts to install Debian packages
- Setting up networking between machines
- Installing Docker (Debian has excellent Docker support)
- Adding lightweight services (nginx, redis, etc.)
- Setting up monitoring with lightweight tools
📄 License
This project is licensed under the MIT License.
Ultra-Lightweight Debian! 🐧⚡
Description
Languages
Makefile
100%