apstra

29Modules19Plugins

Overview

Description

This collection provides modules to interact with Apstra.

Readme

Juniper Networks

Juniper Networks Apstra Ansible Collection

This repository contains the Juniper Apstra Ansible Collection, which provides a set of Ansible modules for network management via the Juniper Apstra platform. See the Apstra version compatibility matrix below for supported Apstra versions.

Support

As a Red Hat Ansible Certified Content, this collection is entitled to support through Ansible Automation Platform (AAP).

If you are a Red Hat customer using this collection via Ansible Automation Hub, please open a support case using the Create Issue link in Automation Hub.

If a support case cannot be opened with Red Hat and the collection has been obtained either from Galaxy or GitHub, there is community support available at no charge.

You can join us on #network:ansible.com room or the Ansible Forum Network Working Group.

For more information you can check the communication section below.

Communication

For more information about communication, see the Ansible communication guide.

Ansible version compatibility

This collection has been tested against following Ansible versions: >=2.16.14.

Apstra version compatibility

The following matrix shows which collection version to use with each Juniper Apstra release:

Collection VersionSupported Apstra VersionsNotes
v1.0.86.0, 6.1Current release. Includes new modules: floating_ip, upgrade_management, interconnect_gateway, iba_probes, cabling_map, virtual_infra_manager. Adds tag support, commit descriptions, rack renaming, and many bug fixes.
v1.0.76.0, 6.1Added interconnect_gateway, iba_probes, cabling_map, virtual_infra_manager modules. Name-to-ID resolution across all modules.
v1.0.66.0, 6.1Added rollback, ztp_device, connectivity_template, connectivity_template_assignment, external_gateway, generic_systems, configlets, property_set, resource_pools.
v1.0.55.1Use this version for Apstra 5.x deployments.

Note: Collection versions prior to v1.0.5 are not recommended for production use.

Included Content

Modules

NameDescription
juniper.apstra.apstra_factsGather facts from Apstra (blueprints, virtual networks, security zones, endpoint policies, resource pools, and more). Use gather_network_facts: all or pass a filtered list of object types.
juniper.apstra.authenticateLog in to Apstra and retrieve a session token for use by subsequent modules. Also supports explicit logout.
juniper.apstra.blueprintFull lifecycle management of Apstra blueprints — create, commit, lock/unlock, and delete. Supports graph queries (state: queried) and per-node property patches (state: node_updated). Uses a tag-based mutex to prevent concurrent modifications.
juniper.apstra.configletsCreate, update, and delete configlets in Apstra. Supports global catalog configlets and blueprint-scoped configlets with role-based targeting conditions.
juniper.apstra.connectivity_templateCreate, update, and delete Connectivity Templates (CTs) in an Apstra blueprint. CTs are composed of network primitives (IP Link, BGP Peering, Routing Policy, etc.) and target an application point type (interface, svi, loopback, etc.). Idempotent by name.
juniper.apstra.connectivity_template_assignmentAssign or unassign Connectivity Templates to application point nodes (interfaces) within an Apstra blueprint.
juniper.apstra.designCreate and manage design-layer objects (logical devices, rack types, templates) required before blueprint creation.
juniper.apstra.endpoint_policyCreate, update, and delete endpoint policies and their application points within an Apstra blueprint.
juniper.apstra.external_gatewayCreate, update, and delete external EVPN remote gateways in an Apstra blueprint for inter-DC or WAN BGP/L2VPN peering.
juniper.apstra.fabric_settingsManage fabric-wide settings in an Apstra blueprint (MTU, EVPN parameters, overlay protocol, anti-affinity, SVI/anycast defaults).
juniper.apstra.generic_systemsCreate, update, and delete generic (external) systems in an Apstra blueprint, including their links to fabric switches (LAG mode, speed, port assignments).
juniper.apstra.interface_mapAssign interface maps to blueprint switch nodes, linking them to device profiles that define physical port layout and naming.
juniper.apstra.property_setCreate, update, and delete property sets (key-value stores). Supports both global catalog scope and blueprint scope.
juniper.apstra.resource_groupAssign global resource pools (ASN, IP, IPv6, VLAN, VNI) to named resource groups within an Apstra blueprint.
juniper.apstra.resource_poolsCreate, update, and delete global resource pools in Apstra. Supported types: ASN, Integer, IP, IPv6, VLAN, and VNI.
juniper.apstra.rollbackRoll back a blueprint to a specific revision (state: rolledback), revert to the latest backup (state: reverted), or list available revisions (state: listed).
juniper.apstra.routing_policyCreate, update, and delete routing policies in an Apstra blueprint (BGP import/export filters, aggregate prefixes, extra routes).
juniper.apstra.security_zoneCreate, update, and delete security zones (VRFs) in an Apstra blueprint, including VNI ID, DHCP relay, and routing policy association.
juniper.apstra.system_agentsOnboard, update, and delete NOS system agents in Apstra to connect physical devices to the management plane.
juniper.apstra.tagCreate, update, and delete tags in Apstra. Tags can be applied to blueprint objects and used as configlet targeting selectors.
juniper.apstra.virtual_networkCreate, update, and delete virtual networks (VXLAN/VLAN) in an Apstra blueprint. Configures VN type, VNI ID, IPv4/IPv6 gateways, DHCP, and security zone binding. Supports lookup by label.
juniper.apstra.ztp_deviceCreate, delete, and check the status of ZTP (Zero Touch Provisioning) devices in Apstra. Supports state: present (list all or create), state: absent (delete by IP), and state: status (lookup by IP address or system ID).

Click the Content button to see the list of content included in this collection.

Installation

You can install the Juniper Networks Apstra collection with the Ansible Galaxy CLI:

ansible-galaxy collection install juniper.apstra

You can also include it in a requirements.yml file and install it with ansible-galaxy collection install -r requirements.yml, using the format:

---
collections:
  - name: juniper.apstra

You can ensure that the required packages are installed via pip. For example, if your collection is installed in the default location:

pip install -r ~/.ansible/collections/ansible_collections/juniper/apstra/requirements.txt

Usage

You can call modules by their Fully Qualified Collection Namespace (FQCN), such as juniper.apstra.authenticate. The following example plays show how to log in to Apstra, create a blueprint and gather facts.

The collection is simply an Ansible interface to specific Apstra API. This is why

Login

- name: Connect to Apstra
  juniper.apstra.authenticate:
    api_url: "https://my-apstra/api"
    username: "admin"
    password: "password"
    logout: false
  register: auth

Gather facts

- name: Run apstra_facts module
  juniper.apstra.apstra_facts:
    gather_network_facts: 'all'
    available_network_facts: true
    auth_token: "{{ auth.token }}"
  register: apstra_facts

Create blueprint

- name: Create/get blueprint
  juniper.apstra.blueprint:
    body:
      label: "test_blueprint"
      design: "two_stage_l3clos"
    lock_state: "locked"
    auth_token: "{{ auth.token }}"
  register: bp

Contributing to this collection

We welcome community contributions to this collection. If you find problems, please open an issue or create a PR against the Juniper Networks Apstra collection repository. See Contributing to Ansible-maintained collections for complete details.

You can also join us on:

See the Ansible Community Guide for details on contributing to Ansible.

Code of Conduct

This collection follows the Ansible project's Code of Conduct. Please read and familiarize yourself with this document.

Release Notes

Release notes are available here.

Roadmap

  • Expand coverage of Apstra freeform blueprint resources.
  • Add support for additional design-level objects (rack types, interface groups).
  • Provide idempotent management of system agent profiles.
  • Improve diff output to surface per-field change details for all modules.
  • Publish dedicated documentation pages for design, fabric_settings, interface_map, and system_agents modules.

More Information

Licensing

This collection is available under multiple licenses depending on the component. See LICENSE for the full text.

Primary license: Apache-2.0. Additional licenses used in this project: MIT, GPL-3.0-or-later, BSD-3-Clause.

Certification

Product
2.4
2.5
2.6
DocumentationDependencies
No dependencies
There are currently no dependencies for this collection.
View in Automation Hub
Red Hat logoLinkedInYouTubeFacebookTwitter

Platforms

Products & services

Try, buy, sell

Help

About Red Hat Ecosystem Catalog

The Red Hat Ecosystem Catalog is the official source for discovering and learning more about the Red Hat Ecosystem of both Red Hat and certified third-party products and services.

We’re the world’s leading provider of enterprise open source solutions—including Linux, cloud, container, and Kubernetes. We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2026 Red Hat, LLC
Feedback