---
# Homelab Ansible Inventory
# All hosts accessible via Tailscale (tail.vish.gg)
# Last reconciled: 2026-03-13
#
# This inventory is used by ansible/homelab/ deployment playbooks.
# It is kept consistent with ansible/automation/hosts.ini.
# hosts.ini is the canonical reference — update both when adding hosts.
#
# Host naming convention:
#   Matches automation/hosts.ini names where possible.
#   Underscores used where hyphens would break Ansible variable names.

all:
  vars:
    ansible_python_interpreter: /usr/bin/python3
    ansible_ssh_common_args: '-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'
    docker_compose_version: "2"

  children:

    # -------------------------------------------------------------------------
    # Synology NAS devices
    # ansible_become: false — Synology DSM does not use standard sudo
    # docker_data_path: /volume1/docker — DSM package manager path
    # -------------------------------------------------------------------------
    synology:
      vars:
        docker_data_path: /volume1/docker
        ansible_become: false
        docker_socket: /var/run/docker.sock
        docker_bin: sudo /var/packages/REDACTED_APP_PASSWORD/usr/bin/docker
      hosts:
        atlantis:
          ansible_host: 100.83.230.112
          ansible_user: vish
          ansible_port: 60000
          hostname: atlantis.vish.local
          description: "Primary NAS — Synology DS1823xs+"

        calypso:
          ansible_host: 100.103.48.78
          ansible_user: Vish
          ansible_port: 62000
          hostname: calypso.vish.local
          description: "Secondary NAS — Synology DS920+"

        setillo:
          ansible_host: 100.125.0.20
          ansible_user: vish
          ansible_port: 22
          hostname: setillo.vish.local
          description: "Remote NAS — Synology (Seattle offsite)"

    # -------------------------------------------------------------------------
    # Raspberry Pi nodes
    # -------------------------------------------------------------------------
    rpi:
      vars:
        docker_data_path: /opt/docker
        ansible_become: true
        docker_bin: docker
      hosts:
        pi-5:
          ansible_host: 100.77.151.40
          ansible_user: vish
          hostname: pi-5.vish.local
          description: "Raspberry Pi 5 — uptime-kuma, monitoring"

        # pi-5-kevin:
        #   ansible_host: 100.123.246.75
        #   ansible_user: vish
        #   hostname: pi-5-kevin.vish.local
        #   description: "Raspberry Pi 5 (Kevin's)"
        #   NOTE: commented out — frequently offline, causes ansible exit code 4

    # -------------------------------------------------------------------------
    # Hypervisors and infrastructure hosts
    # -------------------------------------------------------------------------
    hypervisors:
      vars:
        docker_data_path: /opt/docker
        ansible_become: true
        docker_bin: docker
      hosts:
        pve:
          ansible_host: 100.87.12.28
          ansible_user: root
          hostname: pve.vish.local
          description: "Proxmox VE hypervisor"
          # LXC 103: tdarr-node at 192.168.0.180 (LAN-only, no Tailscale)
          # LXC 104: headscale-test

        truenas-scale:
          ansible_host: 100.75.252.64
          ansible_user: vish
          hostname: guava.vish.local
          description: "TrueNAS Scale — guava"
          docker_data_path: /mnt/pool/docker
          # WARNING: do NOT run apt update on TrueNAS — use web UI only

        homeassistant:
          ansible_host: 100.112.186.90
          ansible_user: hassio
          hostname: homeassistant.vish.local
          description: "Home Assistant OS"
          # WARNING: exclude from apt updates — HA manages its own packages

    # -------------------------------------------------------------------------
    # Remote and physical compute hosts
    # -------------------------------------------------------------------------
    remote:
      vars:
        docker_data_path: /opt/docker
        ansible_become: true
        docker_bin: docker
      hosts:
        vish-concord-nuc:
          ansible_host: 100.72.55.21
          ansible_user: vish
          hostname: concord-nuc.vish.local
          description: "Intel NUC — concord"

        seattle:
          ansible_host: 100.82.197.124
          ansible_user: root
          hostname: seattle.vish.local
          description: "Seattle VPS (Contabo) — bookstack, surmai, pufferpanel"

    # -------------------------------------------------------------------------
    # Local VMs on-site
    # -------------------------------------------------------------------------
    local_vms:
      vars:
        docker_data_path: /opt/docker
        ansible_become: true
        docker_bin: docker
      hosts:
        homelab:
          ansible_host: 100.67.40.126
          ansible_user: homelab
          hostname: homelab-vm.vish.local
          description: "Primary homelab VM — this machine"

        matrix-ubuntu:
          ansible_host: 100.85.21.51
          ansible_user: test
          hostname: matrix-ubuntu.vish.local
          description: "Matrix/Mattermost Ubuntu VM"
          # LAN: 192.168.0.154

    # -------------------------------------------------------------------------
    # Functional groups (mirrors automation/hosts.ini grouping)
    # -------------------------------------------------------------------------

    # All reachable managed hosts — use this for most playbooks
    active:
      children:
        homelab_group:
        synology:
        rpi:
        hypervisors:
        remote:
        local_vms:

    # Hosts using Calypso as APT proxy (apt-cacher-ng)
    debian_clients:
      hosts:
        homelab:
        pi-5:
        # pi-5-kevin:  # offline
        vish-concord-nuc:
        pve:
        matrix-ubuntu:
        seattle:

    # Hosts running Portainer edge agents
    portainer_edge_agents:
      hosts:
        homelab:
        vish-concord-nuc:
        pi-5:
        calypso:

    # Legacy compatibility group
    homelab_linux:
      children:
        homelab_group:
        synology:
        rpi:
        hypervisors:
        remote:

    # Internal group to avoid name collision between host 'homelab' and group
    homelab_group:
      hosts:
        homelab:

    # -------------------------------------------------------------------------
    # Remote personal devices
    # -------------------------------------------------------------------------
    personal:
      vars:
        docker_data_path: /opt/docker
        ansible_become: true
        docker_bin: docker
      hosts:
        # moon:
        #   ansible_host: 100.64.0.6
        #   ansible_user: vish
        #   hostname: moon.vish.local
        #   description: "Honolulu — sibling's PC"
        #   NOTE: commented out — frequently offline

        jellyfish:
          ansible_host: 100.69.121.120
          ansible_user: lulu
          hostname: jellyfish.vish.local
          description: "Jellyfish — local NAS (3.6TB SSD)"

    # -------------------------------------------------------------------------
    # Network devices (OpenWrt routers)
    # -------------------------------------------------------------------------
    routers:
      vars:
        ansible_become: false
        ansible_python_interpreter: /usr/bin/python3
      hosts:
        gl-mt3000:
          ansible_host: 100.126.243.15
          ansible_user: root
          hostname: gl-mt3000.vish.local
          description: "GL.iNet MT3000 travel router"

        gl-be3600:
          ansible_host: 100.105.59.123
          ansible_user: root
          hostname: gl-be3600.vish.local
          description: "GL.iNet BE3600 WiFi 7 router"

    # -------------------------------------------------------------------------
    # SSH mesh — all hosts that participate in key-based SSH mesh
    # Used by playbooks/ssh_mesh.yml
    # -------------------------------------------------------------------------
    ssh_mesh:
      vars:
        admin_key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBuJ4f8YrXxhvrT+4wSC46myeHLuR98y9kqHAxBIcshx admin@thevish.io"
      children:
        synology:
        rpi:
        remote:
        local_vms:
        personal:
        routers:
      hosts:
        truenas-scale:
        pve:

    # -------------------------------------------------------------------------
    # Tailscale update groups — used by playbooks/tailscale_update.yml
    # -------------------------------------------------------------------------

    # All hosts running Tailscale
    tailscale_hosts:
      children:
        apt_tailscale:
        tailscale_manual:

    # Hosts that update Tailscale via apt (official repo)
    apt_tailscale:
      hosts:
        homelab:
        pi-5:
        vish-concord-nuc:
        seattle:
        matrix-ubuntu:
        pve:
        # moon:  # offline
        jellyfish:

    # Hosts that require manual Tailscale updates (report only)
    tailscale_manual:
      hosts:
        atlantis:
          tailscale_update_method: "Synology DSM Package Center"
          tailscale_update_instructions: "DSM > Package Center > Tailscale > Update"
        calypso:
          tailscale_update_method: "Synology DSM Package Center"
          tailscale_update_instructions: "DSM > Package Center > Tailscale > Update"
        setillo:
          tailscale_update_method: "Synology DSM Package Center"
          tailscale_update_instructions: "DSM > Package Center > Tailscale > Update"
        truenas-scale:
          tailscale_update_method: "TrueNAS Apps UI (Docker)"
          tailscale_update_instructions: "TrueNAS UI > Apps > Tailscale > Update"
        gl-mt3000:
          tailscale_update_method: "GL.iNet Admin Panel"
          tailscale_update_instructions: "GL.iNet Admin > Applications > Tailscale"
        gl-be3600:
          tailscale_update_method: "GL.iNet Admin Panel"
          tailscale_update_instructions: "GL.iNet Admin > Applications > Tailscale"

    # -------------------------------------------------------------------------
    # Offline / LAN-only hosts — not reachable via Tailscale
    # Documented here for reference, not targeted by playbooks
    # -------------------------------------------------------------------------
    # tdarr_node (LXC 103): 192.168.0.180 — access via: ssh pve "pct exec 103 -- <cmd>"
    # anubis:               unknown IP — not in Tailscale
    # pi-5-kevin:           100.123.246.75 — frequently offline
