Digital Nomads Digital Nomads

OpsMill InfraHub: Deep Dive

OpsMill InfraHub: Deep Dive
Created By: Lauren R. Garcia

Table of Contents

  • Overview
  • Core Components
  • Comparative Analysis
  • Use Cases and Applications
  • Roadmap and Future Enhancements
  • Schema Design Example
  • Getting Started with InfraHub
  • End-to-end Example
  • Conclusion

Overview

OpsMill InfraHub is an advanced infrastructure automation platform that revolutionizes the way organizations manage and orchestrate network, cloud, and system data. At its core, InfraHub is powered by a graph database—this is what sets it apart from traditional systems. The graph model allows InfraHub to naturally represent the complex, interconnected relationships between devices, applications, services, dependencies, and environments. This makes searching, visualizing, and managing dynamic infrastructure vastly more efficient and flexible than conventional, table-based approaches.

Think of InfraHub like the modern navigation system in a smart city. While legacy tools are like paper maps—focused on static lists and fixed routes—InfraHub's graph database is like a real-time GPS engine that understands not just every street, but how all intersections, one-way flows, and transit systems connect. If you add a new bridge (a server or a network link), InfraHub instantly "knows" how the entire map changes and updates every path and relationship accordingly. This analogy highlights why understanding the graph foundation is critical—every device, interface, IP, or cloud resource is a node, and the connections between them (dependencies, ownership, policies) are edges.

You need to know about InfraHub if you want:

  • Infrastructure as Code that is versioned, auditable, and supports real CI/CD for infrastructure data.
  • Inventory and resource management that reflects true real-world complexity, not just flat lists.
  • Seamless integrations and automation powered by a flexible GraphQL API, not limited by basic REST call patterns.
  • Extensible, customizable schemas defined in YAML—supporting any unique requirement your environment demands.

How it works:

  • Data is modeled as a graph, not a set of disconnected tables or documents.
  • You interact with the platform using the infrahubctl CLI (not legacy commands or non-existent tools like infrahub-cli), for everything from schema management to infrastructure orchestration.
  • Automation, queries, and integrations are made possible through a robust GraphQL API, which tailors queries and mutations exactly to your needs, rather than traditional REST endpoints.
  • Schemas are defined using precise YAML formats that align with InfraHub’s architecture—avoiding confusion and ensuring rapid adoption for infrastructure teams.

For hands-on guides and technical details, always refer to:

  • The official CLI documentation: infrahubctl
  • The GraphQL API documentation
  • The Schema Library for production-ready examples and blueprints

In summary, OpsMill InfraHub is for engineers who want infrastructure automation that's as flexible, connected, and adaptable as the networks they're building, powered by the intelligence and efficiency of graph technology.

Core Components

These components form the foundation of InfraHub’s architecture and workflow automation capabilities:

  • Graph Database Engine: InfraHub models all infrastructure resources, relationships, and metadata within a native graph database, enabling efficient querying, dynamic dependency mapping, and advanced analytics for complex networks.
  • infrahubctl CLI Tool: The official command-line utility, infrahubctl, is used for managing environments, importing schemas, orchestrating assets, and running infrastructure tasks. For examples and usage, visit the CLI documentation.
  • GraphQL API: InfraHub exposes a flexible GraphQL endpoint for all resource management and data retrieval. This API design allows users to query and manipulate infrastructure objects, topologies, and status with custom payloads. See API queries and mutations at the GraphQL API reference.
  • Schema Library: All resource definitions, device types, and connectivity models are structured as YAML schemas designed for graph storage and traversal. Explore schema formats and customization in the Schema Library.

Quick Tips:
— Always interact with the platform using infrahubctl for local automation and scripting.
— Consult the GraphQL API for integrations with other apps and data feeds.
— Validate all YAML schemas against InfraHub’s supported syntax before deployment.

Comparative Analysis

OpsMill InfraHub stands apart from other network automation and infrastructure management platforms due to its graph database foundation, flexible schema design, and modern integration model. Below is a detailed comparison to illustrate these fundamental differences.

Feature OpsMill InfraHub Traditional NMS/Source of Truth
Database Architecture Uses a native graph database, modeling objects and relationships for complex real-world infrastructure topologies. Typically uses relational (SQL) or document (NoSQL) databases, requiring additional joins or workarounds for relationships.
Schema Flexibility Enables fully customizable, user-defined schemas in YAML. No pre-defined data model constraints; schema can evolve over time. Usually locked to a fixed schema, limiting extensibility and customization for new business requirements.
Version Control Integrated Git-like branching, diffing, and merging built into the platform; supports true CI workflows for infrastructure data. Version control is often external or limited to manual snapshots/tickets, complicating audit trails and collaboration.
API Model All data operations are driven by GraphQL endpoints, supporting complex queries and mutations with precise data selection. Traditional tools expose REST endpoints with rigid object models and limited query flexibility.
CLI Tooling Official command-line is infrahubctl; supports infrastructure schema loading, data queries, and automation orchestration. Many legacy platforms rely on basic REST wrappers, limited scripting, or ad hoc utility scripts.
Extensibility Open library of schemas and community-driven extensions; adaptable to evolving requirements and integrations. Schema extensions must often be requested from the vendor or done through complex migrations.

For technical details and usage, see the official documentation:

Use Cases and Applications

OpsMill InfraHub’s approach—centered around a graph database, open schema models, and extensible integrations—enables a broad range of automation and orchestration scenarios across IT infrastructure and network domains. Here are some representative use cases:

  • Network Source of Truth: Consolidate device, interface, IP address, and topology data in a single, queryable graph-backed repository that supports version control, branching, and rich access control models.
  • CI/CD for Network and Cloud Automation: Drive configuration, provisioning, and compliance updates through Git-like workflows, automated CI validation, and artifact generation—empowering teams to test and merge changes safely.
  • Resource Pool Management: Allocate and track shared infrastructure resources (such as IPs, VLANs, or compute nodes) using branch-agnostic, idempotent policies—via the resource manager with tracking for allocation states.
  • API-Driven Integrations: Query and mutate infrastructure data using the built-in GraphQL API, enabling seamless integration with automation frameworks, dashboards, and external databases.
  • Extensible Schemas for Custom Models: Evolve or define new schemas for unique business requirements—covering everything from custom device types to non-network assets—all stored with their relationships in the graph.
  • Event-Driven Automation: Orchestrate workflows and remediation actions based on triggers using webhooks, computed attributes, and event-handling extensions that tie into configuration automation or security responses.
  • Data Synchronization & Federation: Sync and aggregate data across sources-of-truth such as Netbox, Nautobot, or CMDBs using the infrahubctl CLI and automated integration flows.

For workflow automation examples, schema design, and integration guides, see:

Roadmap and Future Enhancements

InfraHub’s development continues at a fast pace, with enhancements targeting automation scalability, developer productivity, and streamlined infrastructure management through its graph database–driven core.

  • Recent Features:
    • Templates for Object Creation: Speed up recurring infrastructure tasks with reusable templates, enabling standardized creation of complex network or system objects from blueprints.
    • Integrated Activity Logging: Gain complete visibility with detailed audit trails and per-object change histories built directly into the platform.
    • Advanced Webhook & Event Triggers: Enable richer event-driven automation and external system integration using expanded webhook configurations and payload options.
    • Performance and UI Optimizations: Benefit from improved list retrieval, query speeds, and an updated, streamlined user interface for high-volume operations.
  • Next Steps (Planned Enhancements):
    • Expanded Generator Functions: Enhance automation by generating more complex infrastructure objects and topologies directly from service models, all mapped and versioned within the graph.
    • Deeper Platform Engineering Features: Support hybrid and multi-cloud workflows with improved integrations for public cloud and on-premises automation, enabling unified infrastructure as a service catalog—including support for AI and GPU data center modeling.
    • Broader Schema Blueprint Library: Roll out pre-built blueprints and example schemas for common domains, expansively growing out-of-box options for rapid onboarding and experimentation.
    • Greater Federation and Synchronization: Improve interoperability with existing tools and sources-of-truth through enhanced data sync and schema mapping features.
    • Collaborative Validation and Peer Review: Build on proposed change workflows by enhancing support for reviews, validations, and in-platform approvals before data is merged to production.

Stay up to date with current and future features at:

Schema Design Example

InfraHub schemas define infrastructure objects, attributes, and relationships as first-class nodes within a flexible graph. Below is a guided workflow for building and evolving a device and interface schema that aligns with the actual Infrahub platform.

  1. Define the core nodes and attributes:
    Create a schema_guide.yml file and add these entities in the Network namespace:
    version: "1.0"
    nodes:
      - name: Device
        namespace: Network
        human_friendly_id: ['hostname__value']
        attributes:
          - name: hostname
            kind: Text
            unique: true
          - name: model
            kind: Text
      - name: Interface
        namespace: Network
        attributes:
          - name: name
            kind: Text
          - name: description
            kind: Text
            optional: true
    
  2. Load the schema branch with infrahubctl:
    infrahubctl branch create network-device-schema
    infrahubctl schema load --branch network-device-schema /tmp/schema_guide.yml
  3. Add relationships between nodes:
    Update your schema to link devices and interfaces:
    version: "1.0"
    nodes:
      - name: Device
        namespace: Network
        human_friendly_id: ['hostname__value']
        attributes:
          - name: hostname
            kind: Text
            unique: true
          - name: model
            kind: Text
        relationships:
          - name: interfaces
            cardinality: many
            peer: NetworkInterface
            kind: Component
      - name: Interface
        namespace: Network
        attributes:
          - name: name
            kind: Text
          - name: description
            kind: Text
            optional: true
        relationships:
          - name: device
            cardinality: one
            peer: NetworkDevice
            kind: Parent
            optional: false
    
    Reload for relationship updates:
    infrahubctl branch create network-device-relations
    infrahubctl schema load --branch network-device-relations /tmp/schema_guide.yml
  4. Test with GraphQL:
    mutation {
      NetworkDeviceCreate(data: {hostname: {value: "atl1-edge1"}, model: {value: "Cisco ASR1002-HX"}}) {
        ok object { id }
      }
      NetworkInterfaceCreate(data: {name: {value: "Ethernet1"}, description: {value: "WAN interface"}, device: {hfid: "atl1-edge1"}}) {
        ok object { id }
      }
    }
        
  5. Iterate and migrate your schema: Refine by adding generic nodes, abstraction, uniqueness constraints, and new attributes. Preview and apply migrations using:
    infrahubctl schema check --branch network-device-generics /tmp/schema_guide.yml
    infrahubctl schema load --branch network-device-generics /tmp/schema_guide.yml
        

For advanced concepts, best practices, and ready-to-use models, see:

Getting Started with InfraHub

OpsMill InfraHub is built around a graph database that enables dynamic modeling and versioned control of infrastructure data. The following steps walk through the process to install, configure, and begin using InfraHub in a real scenario.

  1. Install and configure Infrahubctl:
    • Install the Infrahub Python SDK and CLI (infrahubctl) on the local workstation.
    • Configure connectivity in infrahubctl.toml or with environment variables:
      INFRAHUB_ADDRESS=http://:8000
      INFRAHUB_API_TOKEN=
              
  2. Start the InfraHub server:
    • Deploy InfraHub via the provided installer, container image, or as a Python package as outlined in the official guides.
    • Access the WebUI at http://:8000 for documentation, search, and the integrated GraphQL sandbox.
  3. Load and validate your schema:
    • Define schema elements and relationships in YAML, matching the format shown in the Schema Design Example above.
    • Load your schema with infrahubctl schema load --branch .yml
    • Validate using infrahubctl schema check
  4. Populate and query data via the GraphQL API:
    • Use the in-browser GraphQL sandbox or the CLI to create and retrieve objects (see the previous section for actual mutation/query examples).
    • Integrate automation frameworks (Ansible, Nornir) by using InfraHub as an inventory source or to trigger deployments through webhooks and plugins.
  5. Explore and expand:
    • Experiment with branch management, schema evolution, and building workflows, using the graph’s version control features.
    • Review advanced guides and schema blueprints for production adoption and integration with existing automation tooling.

For full configuration, CLI reference, and integration walkthroughs, see:

End-to-end Example

This step-by-step walkthrough shows how InfraHub's graph database foundation and unified toolset support a full infrastructure automation workflow. The example covers schema design and loading, data creation via GraphQL, and using `infrahubctl` for operational branching and CI/CD with infrastructure data.

  1. Prepare a schema for network devices and interfaces:
    version: "1.0"
    nodes:
      - name: Device
        namespace: Network
        human_friendly_id: ['hostname__value']
        attributes:
          - name: hostname
            kind: Text
            unique: true
          - name: model
            kind: Text
        relationships:
          - name: interfaces
            cardinality: many
            peer: NetworkInterface
            kind: Component
      - name: Interface
        namespace: Network
        attributes:
          - name: name
            kind: Text
          - name: description
            kind: Text
            optional: true
        relationships:
          - name: device
            cardinality: one
            peer: NetworkDevice
            kind: Parent
            optional: false
        
  2. Load schema into a feature branch:
    infrahubctl branch create edge-network
    infrahubctl schema load --branch edge-network ./network_schema.yml
        
  3. Create initial device and interface data with GraphQL:
    mutation {
      NetworkDeviceCreate(data: {hostname: {value: "access-01"}, model: {value: "Arista 7050SX"}}) {
        ok object { id }
      }
      NetworkInterfaceCreate(data: {name: {value: "Ethernet1"}, description: {value: "WAN Interface"}, device: {hfid: "access-01"}}) {
        ok object { id }
      }
    }
        
  4. Propose changes and run CI checks:
    • All changes exist in feature branches—run validation before merging:
    • infrahubctl branch check edge-network
      infrahubctl branch propose edge-network --title "Add access switch and WAN interface"
            
  5. Integrate with automation tooling:
    • Use Nornir or Ansible modules to query and deploy device configuration based on approved InfraHub inventory, either with GraphQL queries or Python SDK.
    • All resource states, templates, and relationships remain tracked in the graph, versioned and auditable.

To deepen practical expertise, review these official guides:

Conclusion

Throughout this blog post, we’ve taken a comprehensive journey through OpsMill and its innovative Infrahub platform. We started with an overview of what OpsMill is and why it’s rapidly becoming essential in the world of infrastructure automation. We explored its key features, such as a unified source of truth, flexible schema design, built-in version control, and robust CI/CD integration, all of which empower teams to automate confidently and collaborate securely.

We highlighted the hands-on labs and community resources available, making it easy for users to learn, experiment, and connect with other practitioners. Real-world use cases demonstrated how OpsMill is making a difference in industries ranging from AI data centers to retail and edge computing. The roadmap section gave us a glimpse into the future, showing OpsMill’s commitment to continuous improvement and innovation. We also looked at a practical schema design example and shared a variety of additional resources to support your journey.

Takeaways:

  • OpsMill’s Infrahub is a powerful, flexible platform designed to centralize, automate, and scale infrastructure operations.
  • Its open, extensible approach means you can model any infrastructure and adapt quickly as your needs evolve.
  • Built-in collaboration, security, and automation features help organizations reduce errors, speed up deployments, and maintain control at scale.
  • A vibrant community and wealth of resources ensure you’re never alone as you adopt and master the platform.

Thank you for joining us on this deep dive into OpsMill! Whether you’re just starting your automation journey or looking to take your infrastructure operations to the next level, OpsMill and Infrahub offer the tools, support, and community you need to succeed. Happy automating! 🚀

Read next

NetBox vs. Nautobot vs. InfraHub

NetBox vs. Nautobot vs. InfraHub

Table of Contents * Overview of Each Platform * Core Features and Architecture * Deployment and Maintenance * User Experience * Automation and Network Integration * Security Considerations * Open Source and

Lauren Garcia • • 12 min read
How To Address Tool Sprawl

How To Address Tool Sprawl

Table of Contents * Overview * The Hidden Costs of Tool Sprawl * Signs Your Organization Has a Tool Sprawl Problem * Conducting a Tool Audit * Building a Tool

Lauren Garcia • • 10 min read
Batfish: Analysis Output

Batfish: Analysis Output

Table of Contents * Overview * Routing Table Analysis * Interface Status and Configuration Results * Access Control List (ACL) Evaluation * BGP Session and Route Analysis * Configuration Parse Status

Lauren Garcia • • 8 min read