# dazzathewiz/infrastructure architecture

> Architecture diagram of the GitHub repository dazzathewiz/infrastructure, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dazzathewiz/infrastructure
- Repository: https://github.com/dazzathewiz/infrastructure

## Overview

This repository is Ansible-based infrastructure-as-code for a homelab: an operator runs playbooks to configure hosts, provision virtual machines and cluster nodes, and manage Proxmox and service containers. Separate Ansible modules provide Proxmox resource management, while a TrueNAS script independently analyzes duplicate media and can delete selected files. The README documents the main operator workflows; some playbook-to-role wiring and unsampled subsystems are only identified by their paths, so those links are omitted rather than assumed.

Main entry points: [`module_utils/pvesh.py`](https://github.com/dazzathewiz/infrastructure/blob/master/module_utils/pvesh.py) (pvesh Adapter), [`scripts/truenas/truenas_dedupe.py`](https://github.com/dazzathewiz/infrastructure/blob/master/scripts/truenas/truenas_dedupe.py) (Media Deduplication), [`proxmox.yml`](https://github.com/dazzathewiz/infrastructure/blob/master/proxmox.yml) (Proxmox Management), [`dietpi-default.yml`](https://github.com/dazzathewiz/infrastructure/blob/master/dietpi-default.yml) (DietPi Setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_playbooks["Host Configuration"]
  node_controlhost["Control Host Setup"]
  node_proxmoxplay["Proxmox Management<br/>[proxmox.yml]"]
  node_dietpiplay["DietPi Setup<br/>[dietpi-default.yml]"]
  node_proxmoxrole["Proxmox Host Role"]
  node_dietpirole["DietPi Role"]
  node_commonrole["Common Host Role"]
  node_containerroles["Container Services"]
end

subgraph group_provisioning["Provisioning"]
  node_k3sdeploy["k3s Node Deployment"]
  node_k3sconfig["k3s Configuration<br/>[k3s.yml]"]
  node_vmprovision["VM Provisioning"]
  node_maas["MaaS Provisioning"]
end

subgraph group_proxmox["Proxmox Modules"]
  node_storage["Storage Manager<br/>[proxmox_storage.py]"]
  node_metrics["Metrics Manager<br/>[proxmox_metrics.py]"]
  node_user["User Manager<br/>[proxmox_user.py]"]
  node_group["Group Manager<br/>[proxmox_group.py]"]
  node_pool["Pool Manager<br/>[proxmox_pool.py]"]
  node_role["Role Manager<br/>[proxmox_role.py]"]
  node_acl["ACL Manager<br/>[proxmox_acl.py]"]
  node_query["Proxmox Query<br/>[proxmox_query.py]"]
  node_pvesh["pvesh Adapter<br/>[pvesh.py]"]
  node_cephvolume["Ceph Volume Query<br/>[pve_ceph_volume.py]"]
  node_kernelinfo["Kernel Inspector"]
end

subgraph group_utilities["Storage Utilities"]
  node_dedupe["Media Deduplication<br/>[truenas_dedupe.py]"]
end

node_operator(("Operator"))
node_proxmoxapi["Proxmox CLI"]
node_truefiles[("TrueNAS Files")]
node_unraidmanifest["Unraid Manifest"]

node_operator -->|"runs"| node_controlhost
node_operator -->|"runs"| node_proxmoxplay
node_operator -->|"runs"| node_dietpiplay
node_operator -->|"runs"| node_k3sdeploy
node_operator -->|"runs"| node_k3sconfig
node_operator -.->|"runs"| node_dedupe
node_proxmoxplay -.->|"configures"| node_proxmoxrole
node_dietpiplay -.->|"configures"| node_dietpirole
node_dietpirole -->|"uses"| node_commonrole
node_k3sdeploy -.->|"provisions"| node_vmprovision
node_operator -->|"provisions"| node_maas
node_storage -->|"calls"| node_pvesh
node_metrics -->|"calls"| node_pvesh
node_user -->|"calls"| node_pvesh
node_group -->|"calls"| node_pvesh
node_pool -->|"calls"| node_pvesh
node_role -->|"calls"| node_pvesh
node_acl -->|"calls"| node_pvesh
node_query -->|"calls"| node_pvesh
node_pvesh -->|"executes"| node_proxmoxapi
node_cephvolume -.->|"queries"| node_proxmoxapi
node_dedupe -->|"scans and deletes"| node_truefiles
node_dedupe -->|"reads"| node_unraidmanifest

click node_controlhost "https://github.com/dazzathewiz/infrastructure/blob/master/setup-control-host.yml"
click node_proxmoxplay "https://github.com/dazzathewiz/infrastructure/blob/master/proxmox.yml"
click node_dietpiplay "https://github.com/dazzathewiz/infrastructure/blob/master/dietpi-default.yml"
click node_k3sdeploy "https://github.com/dazzathewiz/infrastructure/blob/master/vm_deploy_kubernetes.yml"
click node_k3sconfig "https://github.com/dazzathewiz/infrastructure/blob/master/k3s.yml"
click node_vmprovision "https://github.com/dazzathewiz/infrastructure/tree/master/roles/proxmox_provision/tasks"
click node_maas "https://github.com/dazzathewiz/infrastructure/tree/master/roles/maas/tasks"
click node_proxmoxrole "https://github.com/dazzathewiz/infrastructure/tree/master/roles/proxmox/tasks"
click node_dietpirole "https://github.com/dazzathewiz/infrastructure/tree/master/roles/dietpi/tasks"
click node_commonrole "https://github.com/dazzathewiz/infrastructure/tree/master/roles/common/tasks"
click node_containerroles "https://github.com/dazzathewiz/infrastructure/tree/master/roles/containers"
click node_storage "https://github.com/dazzathewiz/infrastructure/blob/master/library/proxmox_storage.py"
click node_metrics "https://github.com/dazzathewiz/infrastructure/blob/master/library/proxmox_metrics.py"
click node_user "https://github.com/dazzathewiz/infrastructure/blob/master/library/proxmox_user.py"
click node_group "https://github.com/dazzathewiz/infrastructure/blob/master/library/proxmox_group.py"
click node_pool "https://github.com/dazzathewiz/infrastructure/blob/master/library/proxmox_pool.py"
click node_role "https://github.com/dazzathewiz/infrastructure/blob/master/library/proxmox_role.py"
click node_acl "https://github.com/dazzathewiz/infrastructure/blob/master/library/proxmox_acl.py"
click node_query "https://github.com/dazzathewiz/infrastructure/blob/master/library/proxmox_query.py"
click node_pvesh "https://github.com/dazzathewiz/infrastructure/blob/master/module_utils/pvesh.py"
click node_cephvolume "https://github.com/dazzathewiz/infrastructure/blob/master/library/pve_ceph_volume.py"
click node_kernelinfo "https://github.com/dazzathewiz/infrastructure/blob/master/library/collect_kernel_info.py"
click node_dedupe "https://github.com/dazzathewiz/infrastructure/blob/master/scripts/truenas/truenas_dedupe.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_controlhost,node_proxmoxplay,node_dietpiplay,node_proxmoxrole,node_dietpirole,node_commonrole,node_containerroles toneBlue
class node_k3sdeploy,node_k3sconfig,node_vmprovision,node_maas,node_truefiles toneAmber
class node_storage,node_metrics,node_user,node_group,node_pool,node_role,node_acl,node_query,node_pvesh,node_cephvolume,node_kernelinfo toneMint
class node_dedupe toneRose
class node_operator,node_proxmoxapi,node_unraidmanifest toneIndigo
```

## Components

### Host Configuration

- [Control Host Setup](https://github.com/dazzathewiz/infrastructure/blob/master/setup-control-host.yml): `setup-control-host.yml`
- [Proxmox Management](https://github.com/dazzathewiz/infrastructure/blob/master/proxmox.yml): `proxmox.yml`
- [DietPi Setup](https://github.com/dazzathewiz/infrastructure/blob/master/dietpi-default.yml): `dietpi-default.yml`
- [Proxmox Host Role](https://github.com/dazzathewiz/infrastructure/tree/master/roles/proxmox/tasks): `roles/proxmox/tasks`
- [DietPi Role](https://github.com/dazzathewiz/infrastructure/tree/master/roles/dietpi/tasks): `roles/dietpi/tasks`
- [Common Host Role](https://github.com/dazzathewiz/infrastructure/tree/master/roles/common/tasks): `roles/common/tasks`
- [Container Services](https://github.com/dazzathewiz/infrastructure/tree/master/roles/containers): `roles/containers`

### Provisioning

- [k3s Node Deployment](https://github.com/dazzathewiz/infrastructure/blob/master/vm_deploy_kubernetes.yml): `vm_deploy_kubernetes.yml`
- [k3s Configuration](https://github.com/dazzathewiz/infrastructure/blob/master/k3s.yml): `k3s.yml`
- [VM Provisioning](https://github.com/dazzathewiz/infrastructure/tree/master/roles/proxmox_provision/tasks): `roles/proxmox_provision/tasks`
- [MaaS Provisioning](https://github.com/dazzathewiz/infrastructure/tree/master/roles/maas/tasks): `roles/maas/tasks`

### Proxmox Modules

- [Storage Manager](https://github.com/dazzathewiz/infrastructure/blob/master/library/proxmox_storage.py): `library/proxmox_storage.py`
- [Metrics Manager](https://github.com/dazzathewiz/infrastructure/blob/master/library/proxmox_metrics.py): `library/proxmox_metrics.py`
- [User Manager](https://github.com/dazzathewiz/infrastructure/blob/master/library/proxmox_user.py): `library/proxmox_user.py`
- [Group Manager](https://github.com/dazzathewiz/infrastructure/blob/master/library/proxmox_group.py): `library/proxmox_group.py`
- [Pool Manager](https://github.com/dazzathewiz/infrastructure/blob/master/library/proxmox_pool.py): `library/proxmox_pool.py`
- [Role Manager](https://github.com/dazzathewiz/infrastructure/blob/master/library/proxmox_role.py): `library/proxmox_role.py`
- [ACL Manager](https://github.com/dazzathewiz/infrastructure/blob/master/library/proxmox_acl.py): `library/proxmox_acl.py`
- [Proxmox Query](https://github.com/dazzathewiz/infrastructure/blob/master/library/proxmox_query.py): `library/proxmox_query.py`
- [pvesh Adapter](https://github.com/dazzathewiz/infrastructure/blob/master/module_utils/pvesh.py): `module_utils/pvesh.py`
- [Ceph Volume Query](https://github.com/dazzathewiz/infrastructure/blob/master/library/pve_ceph_volume.py): `library/pve_ceph_volume.py`
- [Kernel Inspector](https://github.com/dazzathewiz/infrastructure/blob/master/library/collect_kernel_info.py): `library/collect_kernel_info.py`

### Storage Utilities

- [Media Deduplication](https://github.com/dazzathewiz/infrastructure/blob/master/scripts/truenas/truenas_dedupe.py): `scripts/truenas/truenas_dedupe.py`

### Other components

- **Operator**
- **Proxmox CLI**
- **TrueNAS Files**
- **Unraid Manifest**

## Connections

- Operator → Control Host Setup: runs (evidence: `readme.md`)
- Operator → Proxmox Management: runs (evidence: `readme.md`)
- Operator → DietPi Setup: runs (evidence: `readme.md`)
- Operator → k3s Node Deployment: runs (evidence: `readme.md`)
- Operator → k3s Configuration: runs (evidence: `readme.md`)
- Operator → Media Deduplication: runs
- Proxmox Management → Proxmox Host Role: configures
- DietPi Setup → DietPi Role: configures
- DietPi Role → Common Host Role: uses (evidence: `readme.md`)
- k3s Node Deployment → VM Provisioning: provisions
- Operator → MaaS Provisioning: provisions (evidence: `readme.md`)
- Storage Manager → pvesh Adapter: calls (evidence: `library/proxmox_storage.py`)
- Metrics Manager → pvesh Adapter: calls (evidence: `library/proxmox_metrics.py`)
- User Manager → pvesh Adapter: calls (evidence: `library/proxmox_user.py`)
- Group Manager → pvesh Adapter: calls (evidence: `library/proxmox_group.py`)
- Pool Manager → pvesh Adapter: calls (evidence: `library/proxmox_pool.py`)
- Role Manager → pvesh Adapter: calls (evidence: `library/proxmox_role.py`)
- ACL Manager → pvesh Adapter: calls (evidence: `library/proxmox_acl.py`)
- Proxmox Query → pvesh Adapter: calls (evidence: `library/proxmox_query.py`)
- pvesh Adapter → Proxmox CLI: executes (evidence: `module_utils/pvesh.py`)
- Ceph Volume Query → Proxmox CLI: queries
- Media Deduplication → TrueNAS Files: scans and deletes (evidence: `scripts/truenas/truenas_dedupe.py`)
- Media Deduplication → Unraid Manifest: reads (evidence: `scripts/truenas/truenas_dedupe.py`)
