Set up DevOps for network automation
Build a proper CI/CD pipeline for your network changes — from Git repository to automated deployment with guardrails.
8 steps · For teams ready to go from scripts to full NetDevOps
Understand the architecture
Here is what you are building — a complete loop from an engineer's editor to live network devices, with Git and NAPT in between.
Decision guide: which parts do you need?
Scripts run automatically on push
Follow Steps 1–5
AI-assisted automation from your IDE
Follow Steps 1, 6
Full DevOps with approvals & audit
Follow Steps 1–8
Set up your Git repository
If you already have a Git repo, skip to Step 2c.
2a — Create the repository
# Create a new repo for network automation gh repo create network-automation --private --description "Network-as-Code configs" cd network-automation # Or via web: github.com/new
<org>-network-automation or netops-configs. Visibility: Private (contains network topology info).2b — Initialize the repo structure
# Create the standard NAPT repo layout
mkdir -p intent/{production,staging,lab}/{bgp,dc,sdwan,security,compliance}
mkdir -p tests/{routing,fabric,security}
mkdir -p pipelines
mkdir -p inventory
mkdir -p scripts
# Create initial files
cat > .gitignore << 'EOF'
# Never commit credentials
.env
*.key
*.pem
devices.csv # may contain credentials
secrets.yaml
# Python
__pycache__/
*.pyc
.venv/
# NAPT local cache
.napt/
EOF
cat > README.md << 'EOF'
# Network Automation Repository
Network-as-Code configurations and automation scripts for NAPT.
## Structure
- intent/ YAML intent files by environment and domain
- tests/ Network validation test suites
- pipelines/ NAPT pipeline definitions (exported JSON)
- inventory/ Device inventory (credentials via NAPT Vault, not here)
- scripts/ Custom Python scripts
EOF
git init && git add . && git commit -m "init: NAPT network automation repo"2c — Connect to NAPT
- Go to
napt.networkgig.in/devops/git→ Connect repository - Paste your repo URL and generate a webhook secret
- Add the webhook to GitHub: Settings → Webhooks → Add webhook
Write your first intent file
Intent files declare desired network state in YAML. NAPT validates them and pipelines enforce them.
Example: intent/staging/bgp/edge-peers.yaml
# Network Intent: Edge BGP Peers — Staging
# Owner: network-team
# Last updated: 2026-06-16
apiVersion: napt.networkgig.in/v1
kind: BGPPeer
metadata:
name: edge-rtr01-transit-a
namespace: staging
labels:
site: mumbai-dc1
role: edge
vendor: cisco_xr
team: network-ops
spec:
localAs: 65000
neighbor: 10.255.0.1 # staging test peer IP
remoteAs: 65001
description: "Staging transit simulation peer"
addressFamily:
ipv4Unicast: true
policy:
inbound: STAGING-TRANSIT-IN
outbound: STAGING-TRANSIT-OUT
security:
ttlSecurity: 1
maxPrefix:
limit: 10000
restartInterval: 5Commit the file
git add intent/staging/bgp/edge-peers.yaml git commit -m "feat(bgp/staging): add transit simulation peer on edge-rtr01" git push origin main
- ✓ Git push detected by the NAPT webhook
- ✓ YAML schema validation runs automatically
- ✓ Pipeline triggers if configured for this path
- ✓ Results appear in Pipeline Studio and the audit log
Create your first pipeline
Navigate to napt.networkgig.in/devops/pipelines → New Pipeline.
Pipeline name: "Staging BGP Change Pipeline"
Trigger: Git push to main (path: intent/staging/bgp/*)
Add these stages in order
- 1
YAML Lint
Validation → YAML Lint
Target: intent/staging/bgp/*.yaml
- 2
Schema Validate
Validation → Schema Validate
Target: same path
- 3
Dry Run
Execution → Script Runner
Script: bgp_community_deploy · Environment: Staging · Mode: Dry run (checked)
- 4
pyATS BGP Test
Test → pyATS Test Suite
Suite: BGP Neighbor State Test · Environment: Staging
- 5
Notify
Post-Deploy → Notify
Channel: Slack #netops · Message: "Staging BGP pipeline complete"
intent/staging/bgp/edge-peers.yaml and watch the pipeline run in real time in Pipeline Studio.Set up environment promotion
Navigate to napt.networkgig.in/devops/environments and create three environments.
Lab
- Devices:
- [tag=lab] from your inventory
- Approval:
- None (auto-proceed)
- Compliance threshold:
- 60%
Staging
- Devices:
- [tag=staging] from your inventory
- Approval:
- None (auto-proceed if tests pass)
- Compliance threshold:
- 75%
Production
- Devices:
- [tag=production] from your inventory
- Approval:
- Manual — 1 approver required
- Compliance threshold:
- 80%
- Maintenance windows:
- Mon–Thu 22:00–06:00 IST · Sat 00:00–08:00 IST
Connect your AI assistant
Install the NAPT MCP package
npm install -g @networkgig/napt-mcp
napt.networkgig.in/mcp/keys (see the MCP docs). It looks like napt_mcp_••••••••••••.For Claude Desktop
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"napt": {
"command": "npx",
"args": ["-y", "@networkgig/napt-mcp"],
"env": {
"NAPT_API_KEY": "napt_mcp_your_key_here",
"NAPT_WORKSPACE": "your_workspace_id_here"
}
}
}
}Restart Claude Desktop → verify by typing "List NAPT tools" in chat. Claude should respond with the available tools.
For Cursor IDE
Create .cursor/mcp.json in your project root:
{
"mcpServers": {
"napt": {
"command": "npx",
"args": ["-y", "@networkgig/napt-mcp"],
"env": { "NAPT_API_KEY": "napt_mcp_your_key_here" }
}
}
}Cursor picks this up automatically on next restart.
Set up GitHub Actions (optional)
For teams using GitHub Actions alongside NAPT pipelines. Create .github/workflows/napt-validate.yml:
name: NAPT Network Validation
on:
push:
paths:
- 'intent/**'
pull_request:
paths:
- 'intent/**'
jobs:
validate:
runs-on: ubuntu-latest
name: Validate network intent files
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install NAPT CLI
run: pip install napt-cli # NAPT's Python CLI (coming soon)
- name: Validate intent files
env:
NAPT_API_KEY: ${{ secrets.NAPT_API_KEY }}
run: |
napt validate intent/ # Schema validation via NAPT API
- name: Run NAPT dry-run
if: github.ref == 'refs/heads/main'
env:
NAPT_API_KEY: ${{ secrets.NAPT_API_KEY }}
SSH_PASS: ${{ secrets.SSH_PASS }}
run: |
napt run --pipeline "Staging BGP Change Pipeline" --dry-run
- name: Post results to PR
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
// Post NAPT pipeline results as PR comment
// (handled by NAPT's PR comment bot if Git integration is connected)Monitor with DORA metrics
Once pipelines are running, check DORA metrics weekly at napt.networkgig.in/devops/metrics.
Deployment Frequency
Aim for daily (even small changes count)
- • Week 1: 1–2 deployments (learning)
- • Month 1: 5–10/week (building confidence)
- • Month 3: Daily or multiple/day (elite)
Lead Time
From intent commit to production deploy
- • Initial: Days (manual approval, cautious)
- • Target: Hours (automated validation + approval)
- • Elite: Under 1 hour for pre-approved change types
Change Failure Rate
% of changes needing rollback
- • Target: Under 5% (DORA elite)
- • Above 15%: invest in more test coverage before deploying
MTTR
Time from failure to recovery
- • Target: Under 1 hour
- • NAPT auto-rollback handles most failures automatically
Connect all three (full integration)
The complete DevOps loop, end to end:
- 1. Engineer edits an intent file in VS Code/Cursor (AI assistant via MCP helps write correct YAML).
- 2. Git commit + push → webhook fires to NAPT.
- 3. NAPT Pipeline Studio runs automatically: Validate → Test → Dry-run → [Approval] → Deploy → Verify.
- 4. Results posted back to the PR as a comment.
- 5. Audit trail written automatically.
- 6. DORA metrics updated.
- 7. Morning: engineer asks Claude "NAPT status?" (MCP call returns the overnight summary).
Your CI/CD readiness checklist
Track which parts of your network DevOps stack you've configured. Your selections are saved on this device.