# gijsentius/homelab-playbook architecture

> Architecture diagram of the GitHub repository gijsentius/homelab-playbook, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gijsentius/homelab-playbook
- Repository: https://github.com/gijsentius/homelab-playbook

## Overview

##### Main Components

a. Control Layer:
- Ansible Control Node
- Inventory Management (homelab and cluster environments)
- Playbooks Organization
- Roles Structure

b. Infrastructure Layer:
- Proxmox Virtual Environment (PVE) Nodes
- Docker Containers
- RKE2 (Rancher Kubernetes Engine 2) Cluster

c. Service Layer:
- Rancher Server and Agents
- PowerDNS Infrastructure
- Media Services (Plex, SABnzbd, qBittorrent)
- Support Services (Caddy, NFS, Vault)

**┌─────────────────────────────────────────┐**
- Ansible Control              │
- ┌─────────┐ ┌─────────┐ ┌───────────┐  │
- Inventory│ │Playbooks│ │   Roles   │  │
- ┘ └─────────┘ └───────────┘  │
- ┘

**┌─────────────────────────────────────────┐**
- Infrastructure Components        │
- ┌─────────┐ ┌─────────┐ ┌───────────┐  │
- PVE Nodes│ │ Docker  │ │   RKE2    │  │
- ┘ └─────────┘ └───────────┘  │
- ┘

**┌─────────────────────────────────────────┐**
- Services Layer             │
- ┌─────────┐ ┌─────────┐ ┌───────────┐  │
- PowerDNS │ │ Rancher │ │   Media   │  │
- ┘ └─────────┘ └───────────┘  │
- ┘

##### Key Relationships to Highlight

- Ansible control flow to PVE nodes
- PowerDNS relationships with other services
- Rancher server and agent connections
- Storage relationships (NFS connections)
- Network flow through Caddy reverse proxy

**┌─────────────────────┐**
- ┤
- ▢ Control Component │
- ◇ Infrastructure   │
- ○ Service          │
- → Direct Connection │
- ⟿ Config Flow      │
- ┘

##### Additional Details

- Annotations for important configuration files
- Version information for major components
- Backup and snapshot paths
- Monitoring points

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef control fill:#a8d1f0,stroke:#333
    classDef infra fill:#90EE90,stroke:#333
    classDef service fill:#FFB347,stroke:#333
    classDef critical fill:#FF6961,stroke:#333
    classDef storage fill:#DEB887,stroke:#333

    %% Control Layer
    subgraph Control
        AC[Ansible Control]
        INV[Inventory Management]
        PB[Playbooks]
        ROLES[Roles]
        
        AC --> INV
        AC --> PB
        AC --> ROLES
        
        subgraph Inventory
            HLab[Homelab Environment]
            CLUS[Cluster Environment]
            GV[Group Variables]
            HV[Host Variables]
            
            INV --> HLab
            INV --> CLUS
            INV --> GV
            INV --> HV
        end
    end
    
    %% Infrastructure Layer
    subgraph Infrastructure
        PVE[PVE Nodes]
        DOCK[Docker]
        RKE[RKE2 Cluster]
        
        PVE --> DOCK
        PVE --> RKE
    end
    
    %% Services Layer
    subgraph Services
        subgraph CoreServices
            PDNS[PowerDNS]
            RANCH[Rancher]
        end
        
        subgraph MediaServices
            PLEX[Plex]
            SAB[SABnzbd]
            QBIT[qBittorrent]
        end
        
        subgraph SupportServices
            CADDY[Caddy Proxy]
            NFS[NFS Storage]
            LVM[LVM Storage]
        end
    end
    
    %% Relationships
    PB --> PVE
    ROLES --> CoreServices
    ROLES --> MediaServices
    ROLES --> SupportServices
    PDNS -.-> CADDY
    RANCH -.-> RKE
    MediaServices --> NFS
    MediaServices --> LVM
    
    %% Legend
    subgraph Legend
        L1[Control Component]:::control
        L2[Infrastructure Component]:::infra
        L3[Service Component]:::service
        L4[Critical Service]:::critical
        L5[Storage Component]:::storage
    end
    
    %% Style Applications
    class AC,INV,PB,ROLES control
    class PVE,DOCK,RKE infra
    class PLEX,SAB,QBIT service
    class PDNS,RANCH critical
    class NFS,LVM storage
    
    %% Click Events
    click INV "https://github.com/gijsentius/homelab-playbook/tree/main//inventory"
    click HLab "https://github.com/gijsentius/homelab-playbook/tree/main//inventory/homelab"
    click CLUS "https://github.com/gijsentius/homelab-playbook/tree/main//inventory/cluster"
    click PB "https://github.com/gijsentius/homelab-playbook/tree/main//playbooks"
    click PVE "https://github.com/gijsentius/homelab-playbook/tree/main//roles/pvenode"
    click DOCK "https://github.com/gijsentius/homelab-playbook/tree/main//roles/docker"
    click RANCH "https://github.com/gijsentius/homelab-playbook/tree/main//roles/rancher"
    click PDNS "https://github.com/gijsentius/homelab-playbook/tree/main//roles/powerdns"
    click PLEX "https://github.com/gijsentius/homelab-playbook/tree/main//roles/plex"
    click SAB "https://github.com/gijsentius/homelab-playbook/tree/main//roles/sabnzb"
    click QBIT "https://github.com/gijsentius/homelab-playbook/tree/main//roles/qbittorent"
    click CADDY "https://github.com/gijsentius/homelab-playbook/tree/main//roles/caddy"
    click NFS "https://github.com/gijsentius/homelab-playbook/tree/main//roles/nfs"
    click LVM "https://github.com/gijsentius/homelab-playbook/tree/main//roles/lvm"
    click GV "https://github.com/gijsentius/homelab-playbook/tree/main//inventory/homelab/group_vars"
    click HV "https://github.com/gijsentius/homelab-playbook/tree/main//inventory/homelab/host_vars"
```
