Skip to content

lancamat1/netbox-validated-deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deployment

This repository serves as a lab guide for demonstrating the validated deployment of network device configurations using Netauto tool ecosystem.

Overview

The deployment process is built around the following workflow:

  1. NetBox Custom Script: Acts as the entry point where users select the sites for deployment. This triggers a GitLab pipeline for the selected sites.
  2. GitLab Pipeline: Orchestrates the deployment process with the following steps:
    • Build CML Topology: Uses NetBox data to generate a CML2 YAML file and spin up a staging network that mirrors the network modeled in NetBox.
    • Generate Rendered Configurations: Creates device configurations using NetBox configuration templates and contexts.
    • Provision Topology in CML: Applies the rendered configurations to the staging network in CML.
    • Wait for Convergence: Ensures the staging network is stable and ready for testing.
    • Run Tests using PyATS: Validates the staging network by running automated tests against it.
  3. Manual Confirmation: After successful testing, a manual approval step is required to proceed with deployment.
  4. Deploy Configurations to Production: Applies the validated configurations to the production network.

Components

  • NetBox: Acts as the single source of truth for network device data.
  • Configuration Rendering: Utilizes NetBox configuration templates and config contexts to generate device configurations.
  • NRX Python Module: Generates CML2 or Containerlab YAML files to spin up a staging network that mirrors the network modeled in NetBox.
  • CML Testbed Export: Enables PyATS framework for comprehensive testing against both staging and production networks.
  • Dynamic Ansible Inventory: Uses NetBox to dynamically generate inventory for configuring both staging and production networks with the rendered configurations.
  • NetBox Custom Fields and Links: Provides additional UI buttons for seamless navigation to the staging CML environment and the GitLab pipeline.

Introduce missconfiguration

In netbox, navigate to one of the devices and disable some interfaces. Either keepalive link, peer link, or any of the vpc enabled interfaces. This will cause the tests to fail.

in netbox custom script

create new branch named deployment<script_job_id> trigger a pipeline on this branch this triggered pipeline will

build neccessary stuff pull configs from netbox and commit them onto this branch deploy_staging test_staging cleanup_staging (manual) when the changes are acceptable merge request can be created to main

after this merge request is merged (commit to main) destroy_staging (if not already done) deploy_production

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors