Skip to content

srl-labs/intent-based-ansible-lab

Repository files navigation

Intent-based fabric management with Ansible

A practical example of using Ansible to manage the configuration of an SR Linux fabric with the intent-based approach leveraging the official Ansible collection for SR Linux - read the tutorial on learn.srlinux.dev for a complete walkthrough of this project.


Run this lab in GitHub Codespaces for free.
Learn more about Containerlab for Codespaces.


Choose how to run

  • Codespaces: click the button above and wait for the devcontainer to finish. Everything below is run from the repo root inside Codespaces.
  • Local machine: follow the prerequisites and setup below, then run the same workflow.

Local prerequisites

  1. Containerlab installed. See the official docs.
  2. Git, Docker, and uv.

Tip

Why uv? uv is a single, ultra-fast tool that can replace pip, pipx, virtualenv, pip-tools, poetry, and more. It automatically manages Python versions, handles ephemeral or persistent virtual environments (uv venv), lockfiles, and often runs 10–100× faster than pip installs.

Local setup

# Install uv (Linux/macOS)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install the Nokia SR Linux Ansible collection
uv run ansible-galaxy collection install nokia.srlinux

# Install the fcli tool
uv tool install git+https://github.com/srl-labs/nornir-srl

Quick Start Guide

  1. Deploy the lab topology:
clab deploy -t topo.clab.yml
  1. Run the Ansible playbook:
INTENT_DIR=$(pwd)/intent_examples/infra/underlay_with_fabric_intent
uv run ansible-playbook -i inv/ -e intent_dir=$INTENT_DIR --diff playbooks/cf_fabric.yml
  1. Verify with fcli
fcli -t topo.clab.yml ni
  1. Run other Ansible playbook described here:
https://learn.srlinux.dev/tutorials/programmability/ansible/intent-based-management/config/

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5