You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/architecture/storage.md
+119Lines changed: 119 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -433,6 +433,125 @@ volumes:
433
433
434
434
**Solution:** SQLite database on OCFS2 cluster filesystem
435
435
436
+
## Ansible Storage Role
437
+
438
+
The `ansible/roles/storage` role automates the full iSCSI + OCFS2 setup across all cluster nodes. It is invoked during bootstrap and runs only when `iscsi_enabled` is `true`.
439
+
440
+
### What the Role Does
441
+
442
+
**`tasks/main.yml`** - Entry point that conditionally includes:
443
+
1. `ocfs2-setup.yml` - Installs `ocfs2-tools`, configures the O2CB cluster daemon, and brings the `homelab` cluster online
444
+
2. `iscsi-mount.yml` - Discovers iSCSI targets, logs in, creates OCFS2 filesystems (first run only), mounts them, and verifies cluster-wide access
445
+
446
+
**`tasks/ocfs2-setup.yml`** - Configures the OCFS2 cluster stack:
447
+
- Installs `ocfs2-tools` package
448
+
- Writes `/etc/ocfs2/cluster.conf` from a Jinja2 template
449
+
- Enables and starts the `o2cb` systemd service
450
+
- Brings the `homelab` cluster online and verifies status
451
+
452
+
**`tasks/iscsi-mount.yml`** - Loop-based iSCSI mounting (supports up to 3 mounts):
453
+
- Discovers all iSCSI targets from the NAS via `iscsiadm`
454
+
- Logs into each enabled target and verifies active sessions
455
+
- Creates OCFS2 filesystems on first use (`mkfs.ocfs2`, runs once on manager)
456
+
- Creates mount points and adds entries to `/etc/fstab`
457
+
- Mounts OCFS2 filesystems and verifies write access on every node
458
+
- Runs a cluster test to confirm the shared filesystem is visible across all nodes
459
+
460
+
### Configuration Variables
461
+
462
+
All variables are defined in `ansible/inventory/group_vars/all.yml` and sourced from the root `.env` file:
463
+
464
+
#### Primary iSCSI Mount (`media-apps`)
465
+
466
+
| Variable | Default | Description |
467
+
|----------|---------|-------------|
468
+
| `iscsi_enabled` | `false` | Master switch - enables the storage role |
469
+
| `iscsi_target_ip` | `192.168.86.189` | NAS IP address hosting the iSCSI target |
470
+
| `iscsi_target_port` | `3260` | iSCSI target port |
471
+
| `iscsi_target_iqn` | *(required)* | IQN of the iSCSI target for media-apps |
472
+
| `iscsi_mount_path` | `/mnt/iscsi/media-apps` | Mount point on cluster nodes |
473
+
474
+
#### Second iSCSI Mount (`app-data`)
475
+
476
+
| Variable | Default | Description |
477
+
|----------|---------|-------------|
478
+
| `iscsi_app_data_enabled` | `false` | Enable the app-data mount |
479
+
| `iscsi_app_data_iqn` | *(required)* | IQN of the iSCSI target for app-data |
480
+
| `iscsi_app_data_mount_path` | `/mnt/iscsi/app-data` | Mount point on cluster nodes |
481
+
482
+
#### Third iSCSI Mount (`cache`)
483
+
484
+
| Variable | Default | Description |
485
+
|----------|---------|-------------|
486
+
| `iscsi_cache_enabled` | `false` | Enable the cache mount |
487
+
| `iscsi_cache_iqn` | *(required)* | IQN of the iSCSI target for cache |
488
+
| `iscsi_cache_mount_path` | `/mnt/iscsi/cache` | Mount point on cluster nodes |
489
+
490
+
### How to Enable iSCSI Mounts
491
+
492
+
**Step 1: Configure iSCSI targets on your NAS**
493
+
494
+
Create iSCSI LUNs on your NAS (OpenMediaVault, TrueNAS, etc.) and note the IQN for each. Common IQN format:
- ✅ Forgejo - Self-hosted Git service with issue tracking and CI/CD
130
132
131
133
### 💾 Backup & Recovery
132
134
- ✅ Kopia - Automated encrypted backups to Backblaze B2
133
135
134
-
**Rest Stop Summary:** Production platform with 25 services ✅
136
+
**Rest Stop Summary:** Production platform with 27 services ✅
135
137
136
138
---
137
139
@@ -196,16 +198,21 @@ Our mission is to create the ultimate self-hosting platform that makes running y
196
198
197
199
## 🗺️ The Road Ahead: Future Destinations
198
200
201
+
### ✅ Recently Completed
202
+
203
+
| Service | Details |
204
+
|---------|---------|
205
+
|**Forgejo**| Self-hosted Git service with PostgreSQL backend, Authentik OIDC SSO, SSH access on port 2222, and iSCSI storage. Deployed at `git.yourdomain.com`|
206
+
|**Kolibri**| Offline K-12 educational platform with Khan Academy content, hybrid iSCSI + CIFS storage, optional Authentik OIDC. Deployed at `kolibri.yourdomain.com`|
207
+
199
208
### 🎯 NEEDS (High Priority - Real Gaps to Fill)
200
209
201
210
| Need / Current Gap | Solution | Why It Matters |
202
211
|-------------------|----------|----------------|
203
212
|**Document Management & Archival**<br>No system for organizing scanned documents, PDFs, receipts, tax forms, contracts |**Paperless-ngx**| Long-term archival with OCR, tagging, full-text search, automated organization |
204
213
|**File Sync, Calendar, & Contacts**<br>No unified cloud storage replacement or calendar/contacts synchronization |**NextCloud**| Self-hosted file sync across devices, calendar management, contacts storage, document collaboration |
205
-
|**Source Code Hosting**<br>No local git repository with issue tracking and CI/CD capabilities |**Forgejo**<br>(community-driven Gitea fork) | Self-hosted git repos, issue tracking, pull requests, built-in CI/CD pipelines |
206
214
|**Offline AI Assistance**<br>LibreChat requires external API calls - no true offline AI capability |**Ollama**<br>(integrates with LibreChat) | Run LLMs locally for offline AI assistance, privacy, no API costs |
207
215
|**Offline Navigation Maps**<br>Kiwix has OSM Wiki documentation but not actual map tiles for GPS navigation |**OpenStreetMap Tile Server**| Render and serve map tiles locally for offline navigation and mapping apps |
208
-
|**Offline Educational Content**<br>Wikipedia provides general knowledge but lacks structured K-12 curriculum with video lessons |**Kolibri**<br>(Khan Academy content) | Structured learning paths, video lessons, interactive exercises, progress tracking |
209
216
|**Web Page Archiving**<br>No way to preserve important websites before they disappear or change |**ArchiveBox**| Archive critical web pages, articles, and sites for offline reference and preservation |
0 commit comments