B.W.A Crumbforest Crew // Infrastructure and GitOps Model

Status: RC1 Decentralized Configuration Model
Source of Truth (SoT): Netbox
Orchestrator: Ansible Core Engine
Identity: Bits With Attitude (B.W.A) β€” Structural determinism across all silicon gates.

This document outlines how the Crumbforest Crew maintains absolute, deterministic control of its physical network infrastructure (from waldmitte core-nodes to the newly integrated Zosi NVR / Kamera nodes) using a unified Netbox + Ansible GitOps lifecycle.


🌲 1. Netbox Network Device Facts (Source of Truth)

In our architecture, no IP address, VLAN, physical cable, or MAC address is configured manually. Everything is defined in Netbox.

πŸ’Ύ Node Inventory Specifications for Zosi NVR & Camera

These facts are fetched dynamically from Netbox via the netbox.netbox.nb_inventory Ansible lookup plugin.

Device 1: Zosi NVR Recorder

  • Device Name: waldmitte-nvr-01
  • Device Type: Zosi K8208-W NVR
  • Role: Surveillance Gatekeeper
  • Platform: JAWS RaySharp Linux
  • Primary IP (IPv4): 192.168.88.229/24
  • Primary Interface: wan0 (MAC: 9c:a3:a9:b2:ed:6c (aus Live-ARP auf 88/24; die zuvor notierte 98:fa:9b… gehoert dem nginx-Host .234, nicht dem NVR))
  • Custom Fields (Netbox Meta):
  • camera_channels_total: 8
  • active_channels: [4] (mapping physically to CAM4)
  • storage_capacity_tb: 2
  • custom_http_api_port: 80
  • custom_stream_port: 8880

Device 2: Zosi Ethernet Camera (CAM 4)

  • Device Name: waldmitte-cam-04
  • Device Type: Zosi PoE Dome Camera
  • Role: Skeletal VJ Sensor
  • Platform: Embedded Linux / IP Cam
  • NVR Termination Link: Bound to NVR Port 4 (waldmitte-nvr-01 -> Interface ch4)
  • Custom Fields (Netbox Meta):
  • vj_pose_gate_roi: x_start=250, y_start=100, x_end=640, y_end=360
  • target_midi_channel: 1

πŸŽ›οΈ 2. Ansible Playbook Structure & Custom Role

Our Ansible configuration provides a dedicated role bwa_pose_gate to provision NVR integrations, download Google's .task models, configure the local system environment, and automatically launch the asynchronous pose tracking systemd daemon service on edge nodes (like your Jetson, laptops, or workstation terminals).

Role File Layout (roles/bwa_pose_gate/)

roles/bwa_pose_gate/
β”œβ”€β”€ tasks/
β”‚   β”œβ”€β”€ main.yml             # System packages, Python virtualenvs, and pip tools
β”‚   β”œβ”€β”€ model.yml            # Dynamic verification & download of landmarker tasks
β”‚   └── service.yml          # Provisions the bwa-pose-gate systemd background tracker
β”œβ”€β”€ templates/
β”‚   β”œβ”€β”€ bwa-pose-gate.service.j2  # Systemd daemon config template
β”‚   └── config.json.j2            # Active settings file mapped directly from Netbox Facts
└── vars/
    └── main.yml             # Fallback default configuration variables

Dynamic Ansible Variable Mapping (vars/main.yml)

# Mapped dynamically from our Netbox Device Facts
nvr_ip: "{{ hostvars['waldmitte-nvr-01']['ansible_host'] | default('192.168.88.229') }}"
camera_channel: 3 # Index starts at 0 for CAM4
nvr_user: "admin"
nvr_password: "1234"

workspace_dir: "/home/sysop/workspace/bwa-pose-gate"
venv_path: "/home/sysop/workspace/venv_bwa"
model_download_url: "https://storage.googleapis.com/mediapipe-models/pose_landmarker/pose_landmarker_full/float16/latest/pose_landmarker_full.task"
model_name: "pose_landmarker.task"

πŸ“œ 3. Ansible Role Tasks Implementation (tasks/main.yml)

This playbook demonstrates how the crew deploys the entire Edge-AI setup autonomously:

---
# 1. Package & Environment Setup
- name: Install System dependencies
  apt:
    name:
      - python3-venv
      - python3-pip
      - wget
      - libgl1-mesa-glx # OpenGL support for OpenCV on AMD/Nvidia Jetson GPUs
    state: present
    update_cache: yes
  become: yes

- name: Create Python Virtual Environment
  pip:
    name:
      - opencv-python-headless
      - mediapipe
      - numpy
      - pillow
    virtualenv: "{{ venv_path }}"
    virtualenv_command: "python3 -m venv"

# 2. Dynamic Model Procurement
- name: Check if MediaPipe Neural Model is cached
  stat:
    path: "{{ workspace_dir }}/{{ model_name }}"
  register: model_file

- name: Download Pose Landmarker Neural weights
  get_url:
    url: "{{ model_download_url }}"
    dest: "{{ workspace_dir }}/{{ model_name }}"
    mode: '0644'
  when: not model_file.stat.exists

# 3. Dynamic config file rendering directly from Netbox Device Facts
- name: Deploy dynamic configuration parameters
  template:
    src: config.json.j2
    dest: "{{ workspace_dir }}/config.json"
    mode: '0644'

# 4. Background Systemd Daemon Setup
- name: Template B.W.A Pose-Gate systemd service
  template:
    src: bwa-pose-gate.service.j2
    dest: /etc/systemd/system/bwa-pose-gate.service
    mode: '0644'
  become: yes
  notify: Restart BWA Pose-Gate

- name: Ensure Pose-Gate is fully active and enabled on boot
  systemd:
    name: bwa-pose-gate
    state: started
    enabled: yes
    daemon_reload: yes
  become: yes

🎨 4. Custom Templates (templates/bwa-pose-gate.service.j2)

[Unit]
Description=B.W.A Pose-Gate AI Skeletal / MIDI VJ Streamer
After=network.target

[Service]
Type=simple
User=sysop
WorkingDirectory={{ workspace_dir }}
ExecStart={{ venv_path }}/bin/python3 {{ workspace_dir }}/pose_tracker.py
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

Verified and standardized under CrumbLegal-RC0 protocols. Decentralized, deterministic, and autonomous.