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.
29Modules19Plugins
This collection provides modules to interact with Apstra.
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.
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.
News & Announcements: track project-wide announcements including social events.
The Ansible Bullhorn newsletter: used to announce releases and important changes.
For more information about communication, see the Ansible communication guide.
This collection has been tested against following Ansible versions: >=2.16.14.
The following matrix shows which collection version to use with each Juniper Apstra release:
| Collection Version | Supported Apstra Versions | Notes |
|---|---|---|
| v1.0.8 | 6.0, 6.1 | Current 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.7 | 6.0, 6.1 | Added interconnect_gateway, iba_probes, cabling_map, virtual_infra_manager modules. Name-to-ID resolution across all modules. |
| v1.0.6 | 6.0, 6.1 | Added rollback, ztp_device, connectivity_template, connectivity_template_assignment, external_gateway, generic_systems, configlets, property_set, resource_pools. |
| v1.0.5 | 5.1 | Use this version for Apstra 5.x deployments. |
Note: Collection versions prior to v1.0.5 are not recommended for production use.
| Name | Description |
|---|---|
| juniper.apstra.apstra_facts | Gather 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.authenticate | Log in to Apstra and retrieve a session token for use by subsequent modules. Also supports explicit logout. |
| juniper.apstra.blueprint | Full 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.configlets | Create, update, and delete configlets in Apstra. Supports global catalog configlets and blueprint-scoped configlets with role-based targeting conditions. |
| juniper.apstra.connectivity_template | Create, 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_assignment | Assign or unassign Connectivity Templates to application point nodes (interfaces) within an Apstra blueprint. |
| juniper.apstra.design | Create and manage design-layer objects (logical devices, rack types, templates) required before blueprint creation. |
| juniper.apstra.endpoint_policy | Create, update, and delete endpoint policies and their application points within an Apstra blueprint. |
| juniper.apstra.external_gateway | Create, update, and delete external EVPN remote gateways in an Apstra blueprint for inter-DC or WAN BGP/L2VPN peering. |
| juniper.apstra.fabric_settings | Manage fabric-wide settings in an Apstra blueprint (MTU, EVPN parameters, overlay protocol, anti-affinity, SVI/anycast defaults). |
| juniper.apstra.generic_systems | Create, update, and delete generic (external) systems in an Apstra blueprint, including their links to fabric switches (LAG mode, speed, port assignments). |
| juniper.apstra.interface_map | Assign interface maps to blueprint switch nodes, linking them to device profiles that define physical port layout and naming. |
| juniper.apstra.property_set | Create, update, and delete property sets (key-value stores). Supports both global catalog scope and blueprint scope. |
| juniper.apstra.resource_group | Assign global resource pools (ASN, IP, IPv6, VLAN, VNI) to named resource groups within an Apstra blueprint. |
| juniper.apstra.resource_pools | Create, update, and delete global resource pools in Apstra. Supported types: ASN, Integer, IP, IPv6, VLAN, and VNI. |
| juniper.apstra.rollback | Roll 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_policy | Create, update, and delete routing policies in an Apstra blueprint (BGP import/export filters, aggregate prefixes, extra routes). |
| juniper.apstra.security_zone | Create, update, and delete security zones (VRFs) in an Apstra blueprint, including VNI ID, DHCP relay, and routing policy association. |
| juniper.apstra.system_agents | Onboard, update, and delete NOS system agents in Apstra to connect physical devices to the management plane. |
| juniper.apstra.tag | Create, update, and delete tags in Apstra. Tags can be applied to blueprint objects and used as configlet targeting selectors. |
| juniper.apstra.virtual_network | Create, 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_device | Create, 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.
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
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
- name: Connect to Apstra
juniper.apstra.authenticate:
api_url: "https://my-apstra/api"
username: "admin"
password: "password"
logout: false
register: auth
- name: Run apstra_facts module
juniper.apstra.apstra_facts:
gather_network_facts: 'all'
available_network_facts: true
auth_token: "{{ auth.token }}"
register: apstra_facts
- name: Create/get blueprint
juniper.apstra.blueprint:
body:
label: "test_blueprint"
design: "two_stage_l3clos"
lock_state: "locked"
auth_token: "{{ auth.token }}"
register: bp
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:
#ansible-network irc.libera.chat channelSee the Ansible Community Guide for details on contributing to Ansible.
This collection follows the Ansible project's Code of Conduct. Please read and familiarize yourself with this document.
Release notes are available here.
design, fabric_settings, interface_map, and system_agents modules.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.
| Product |
|---|
| 2.4 |
| 2.5 |
| 2.6 |