Skip to content

Instantly share code, notes, and snippets.

@kolbashj
kolbashj / gist:86c89a90965c7eb60b66a37606383078
Created May 10, 2025 04:52
FIXED: Improper Ansible BGP autonomous system format parsing = BAD --- ansible.netcomon
# 🚧 Debugging and Fixing AS-DOT Parsing in Ansible’s Network Engine
## Summary
While automating BGP configuration parsing with Ansible, I discovered that 32-bit ASNs in **AS-DOT format** (e.g. `65000.1000`) were being silently converted to **incorrect float values** like `65000.1`. This completely broke config pushes, idempotency, and most simply, Ansible facts rendered subsequent operations on BGP data inaccurate.
I commonly use the `cisco_ios` module, and after tracing it down the 'rabbit hole' and into Ansible’s shared `ansible.netcommon` Jinja2 core template logic, I submitted a patch that preserves string fidelity during Jinja2 templating and prevents unintended data loss.
---