Automation Workflows

Integrate Pharos into your Proxmox, CI/CD, and DevOps pipelines.

The true value of Pharos is realized when it becomes the automated backbone of your infrastructure. This guide provides production-ready workflows for Home Lab and Enterprise environments.

🛠️ Proxmox Automation

Achieve zero-touch inventory by registering your LXC containers and VMs automatically during the provisioning process.

The Hook Script

Create a shell script on your Proxmox host (/usr/local/bin/pharos-hook.sh). This script uses the mdb client to notify the Pharos server whenever a container starts or stops.

#!/bin/bash
# Usage: ./pharos-hook.sh <vmid> <phase>
VMID=$1
PHASE=$2

if [ "$PHASE" == "post-start" ]; then
    HOSTNAME=$(pct exec $VMID -- hostname)
    IP=$(pct exec $VMID -- hostname -I | awk '{print $1}')
    # Register with Pharos mdb
    mdb add hostname="$HOSTNAME" ip="$IP" type="machine" vmid="$VMID" status="up"
fi

if [ "$PHASE" == "pre-stop" ]; then
    HOSTNAME=$(pct exec $VMID -- hostname)
    mdb change hostname="$HOSTNAME" status="down"
fi

Enable the Hook

Apply the script to your container or VM configuration:

pct set 100 --hookscript local:snippets/pharos-hook.sh

🚀 CI/CD Integration

Pharos is designed for high-velocity DevSecOps teams. You can automate your infrastructure records by integrating Pharos into your CI/CD pipelines.

Gitea / Local CI

Keep your local registry in sync with your source code.

# Example snippet for a local CI runner
mdb add hostname="web-app-v2" ip="$RUNNER_IP" type="machine"

🩺 Automated Inventory with Pulse

Pharos doesn’t just store static data; it automatically discovers and maintains your fleet’s inventory using pharos-pulse with an Inventory-First approach.

Baseline vs. Delta Strategy

To minimize network overhead and CPU impact, the Pulse agent employs a two-tier reporting strategy:

  1. Baseline (ONLINE): On startup, pharos-pulse collects a full hardware and OS metadata package (CPU Brand, Core count, Total RAM, Kernel version, and Serial Number) and registers it with the server.
  2. Delta (HEARTBEAT): Every 60 minutes, the agent sends a minimal presence signal to maintain the record’s freshness and verify identity.

Presence Lifecycle

Pharos automatically tracks the lifecycle of your nodes based on agent signals:

  • ONLINE: Node has recently sent a baseline or heartbeat signal.
  • OFFLINE: Node has gracefully shut down and sent a final SIGTERM signal.
  • UNREACHABLE: (Inferred) Node hasn’t been seen by the server for over 70 minutes.

Agent-Native Inventory Dashboard

Use the Pharos Console — your lab’s Agent-Native Control Plane — to visualize your entire hardware and software fleet. Click any node to see its deep-linkable Resource-First Identity Card, featuring manufacturer serial numbers and specific kernel versions—essential for security audits and hardware lifecycle management.