# 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 1. **Start all machines:** ```bash make start ``` 2. **Check status:** ```bash make status ``` 3. **Access a machine:** ```bash make ssh-host make ssh-machine1 ``` ## ๐ŸŽ›๏ธ Management Commands ### Using Make ```bash 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 ```bash ./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 ```bash 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 1. **Machines not starting:** ```bash vagrant status vagrant up --debug ``` 2. **Network issues:** ```bash vagrant ssh host -c "ping 192.168.56.10" ``` 3. **SSH issues:** ```bash vagrant ssh-config ``` ### Useful Commands ```bash # Check machine status vagrant status # View machine details vagrant ssh-config # Reload machines vagrant reload # Provision machines vagrant provision ``` ## ๐Ÿง Debian Linux Notes ### **Package Management** ```bash # Update package index apt update # Install packages apt install package-name # Search packages apt search keyword ``` ### **Common Debian Commands** ```bash # Check system info uname -a cat /etc/os-release # Check memory usage free -m # Check disk usage df -h ``` ## ๐ŸŽญ Ansible Integration ### **Prerequisites** ```bash # Install Ansible (on your host machine) pip install ansible # Or on Ubuntu/Debian sudo apt install ansible ``` ### **Ansible Commands** ```bash # 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** ```bash # Test Ansible connectivity ./manage.sh ansible ping # Install dependencies ./manage.sh ansible setup # Deploy applications ./manage.sh ansible deploy ``` ### **Direct Ansible Commands** ```bash # 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: 1. **Adding provisioning scripts** to install Debian packages 2. **Setting up networking** between machines 3. **Installing Docker** (Debian has excellent Docker support) 4. **Adding lightweight services** (nginx, redis, etc.) 5. **Setting up monitoring** with lightweight tools ## ๐Ÿ“„ License This project is licensed under the MIT License. --- **Ultra-Lightweight Debian! ๐Ÿงโšก**