updated the main readme and added vagrant

This commit is contained in:
rezayaghobi-dev
2026-08-16 23:58:39 +03:30
parent 829d73807a
commit f68a8289d4
4 changed files with 67 additions and 4 deletions

View File

@@ -9,7 +9,10 @@ A self-hosted homelab running on Docker Compose, built and maintained on an Ubun
![Prometheus](https://img.shields.io/badge/Prometheus-E6522C?style=flat&logo=prometheus&logoColor=white) ![Prometheus](https://img.shields.io/badge/Prometheus-E6522C?style=flat&logo=prometheus&logoColor=white)
![Grafana](https://img.shields.io/badge/Grafana-F46800?style=flat&logo=grafana&logoColor=white) ![Grafana](https://img.shields.io/badge/Grafana-F46800?style=flat&logo=grafana&logoColor=white)
![Loki](https://img.shields.io/badge/Loki-F5A623?style=flat&logo=grafana&logoColor=white) ![Loki](https://img.shields.io/badge/Loki-F5A623?style=flat&logo=grafana&logoColor=white)
![Kubernetes](https://img.shields.io/badge/K3s-326CE5?style=flat&logo=kubernetes&logoColor=white) ![Kubernetes](https://img.shields.io/badge/Kubernetes-326CE5?style=flat&logo=kubernetes&logoColor=white)
![K3s](https://img.shields.io/badge/K3s-FFC61C?style=flat&logo=k3s&logoColor=white)
![Vagrant](https://img.shields.io/badge/Vagrant-1868F2?style=flat&logo=vagrant&logoColor=white)
![GitLab](https://img.shields.io/badge/GitLab-FC6D26?style=flat&logo=gitlab&logoColor=white)
## Overview ## Overview
@@ -47,6 +50,7 @@ Not everything in this repo runs permanently. Some folders are kept purely as re
| Lab | Folder | Purpose | | Lab | Folder | Purpose |
|---|---|---| |---|---|---|
| **Elastic Stack (ELK)** | `docker-compose/elk/` | Elasticsearch + Kibana, security-enabled, sized for this hardware — a modern-workflow (Elastic Agent/Fleet) alternative to an older Filebeat/Metricbeat-based course reference. Not run continuously since Loki now covers centralized logging here — see [Elastic Stack (ELK)](docs/ElasticStack.md) | | **Elastic Stack (ELK)** | `docker-compose/elk/` | Elasticsearch + Kibana, security-enabled, sized for this hardware — a modern-workflow (Elastic Agent/Fleet) alternative to an older Filebeat/Metricbeat-based course reference. Not run continuously since Loki now covers centralized logging here — see [Elastic Stack (ELK)](docs/ElasticStack.md) |
| **Vagrant test VM** | `docker-compose/vagrant/` | Disposable Debian 12 VirtualBox VM (`bento/debian-12`) on a private-network IP, for testing provisioning scripts and configuration changes before touching the real host |
## Repository structure ## Repository structure
@@ -111,9 +115,13 @@ homelab/
│ │ │ └── Dockerfile │ │ │ └── Dockerfile
│ │ └── backups/ │ │ └── backups/
│ │ └── gitlab-backup.sh │ │ └── gitlab-backup.sh
│ └── elk/ │ ├── elk/
│ ├── docker-compose.yml │ │ ├── docker-compose.yml
│ └── .env.example │ │ └── .env.example
│ └── vagrant/
│ ├── Vagrantfile
│ ├── bootstrap.sh
│ └── README.md
├── ansible/ ├── ansible/
│ └── playbooks/ │ └── playbooks/
│ ├── roles/ │ ├── roles/

34
vagrant/README.md Normal file
View File

@@ -0,0 +1,34 @@
# Vagrant Test VM
A disposable VirtualBox VM for trying out provisioning scripts and configuration changes before running them against the real host — mistakes here cost a `vagrant destroy`, not a broken production service.
## What it creates
- **Box:** `bento/debian-12`
- **Hostname:** `test`
- **Network:** private network, static IP `192.168.56.10` — reachable from the host but isolated from the rest of the LAN
- **Resources:** 1 vCPU, 1024 MB RAM — enough to exercise a bootstrap script or a small playbook run, not meant to run real workloads
## Usage
```bash
vagrant up # create and provision the VM
vagrant ssh # log in
vagrant provision # re-run bootstrap.sh against a VM that's already up
vagrant destroy # tear it down completely
```
## `bootstrap.sh`
Runs automatically on `vagrant up` via Vagrant's shell provisioner. Currently:
```bash
apt-get update
sudo apt install -y vim iptables-persistent bash-completion
```
Baseline packages for a usable shell environment — `iptables-persistent` in particular anticipates using this VM to test firewall rule changes without risking the real host's `iptables` state.
## Why this exists
Testing changes directly on the host (or worse, in production containers) means a bad `iptables` rule or a broken package install has real consequences. This VM gives a throwaway Debian environment matching the host's OS family, so provisioning changes — Ansible playbook edits, install scripts, firewall rules — get a dry run first. `vagrant destroy && vagrant up` resets to a clean slate in a couple of minutes.

16
vagrant/Vagrantfile vendored Normal file
View File

@@ -0,0 +1,16 @@
IMAGE_Debian_12 = "bento/debian-12"
Vagrant.configure("2") do |config|
config.vm.box = IMAGE_Debian_12
config.vm.box_check_update = false
config.vm.hostname = "test"
config.vm.network "private_network", ip: "192.168.56.10"
config.vm.provider "virtualbox" do |vb|
vb.name = "my_vm"
vb.memory = 1024
vb.cpus = 1
end
end

5
vagrant/bootstrap.sh Normal file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
# update and upgrade os
apt-get update
sudo apt install -y vim iptables-persistent bash-completion
#apt-get upgrade -y