Ansible and Python: A network automation practitioner’s view

Summary

  • Ansible and AAP are effective for standardizing network changes and operational runbooks in the context of repeatable, well-bounded work.
  • For network-specific capabilities implemented alongside broader automation control planes, Flock9’s Slurp’it and Netpicker deliver proven performance for supplying network data and validating and automating network operations.
  • When central requirements custom logic, data transformation, API integration, testing, or reusable services, Python can be a good fit.
  • Organizational readiness and strengths, a solid data foundation, and a phased roadmap starting with high-value workflows are key to effective network automation.

Network automation conversations can turn into a choice between Ansible and Python. In practice, that framing is too simple. The better question is how an automation approach should evolve as the work expands from repeatable device tasks to workflows that coordinate data, systems, teams, and decisions.

Ansible is an established choice for network automation, with capabilities for deployment, validation, and operational runbooks. As workflows span more systems or require custom logic, teams may choose to extend Ansible, add Python, or combine them. A mature strategy can make room for both.

Ansible and Python are not wholly separate choices: ansible-core runs on Python, and Python is the language for writing Ansible plugins. The practical choice is often whether a workflow fits Ansible’s playbook model or benefits from direct Python for custom logic and data handling.

Disclosure and author perspective: GDT is an official Red Hat and Flock9 partner. My hands-on experience is more heavily weighted toward Python than Ansible and Ansible Automation Platform (AAP), and I have a preference for Flock9’s network applications. I’ve tried to distinguish documented capabilities from personal preference and frame the comparison around workflows teams can test in their own environments.

Where Ansible fits well in network automation

For repeatable, well-bounded work, Ansible and AAP can be an effective way to standardize network changes and operational runbooks. Ansible’s network modules can configure devices, test and validate network state, and help identify and correct configuration drift, as described in the Ansible network automation documentation.

AAP also provides tools for governed execution, including job templates, multistep workflows, role-based access controls, and self-service interfaces. The Red Hat AAP documentation describes capabilities that help teams make approved automation available to operators without asking everyone to write or run playbooks directly.

Regardless of language or platform, the safety, governance, and operability of automation depend on the design and discipline around it. Teams can pursue those qualities with Ansible, Python, or a combination.

Where network-specific tools fit

Flock9’s Slurp’it and Netpicker offer network-specific capabilities that teams may evaluate alongside a broader automation control plane. Slurp’it focuses on network discovery and structured inventory, with REST application programming interface (API) access and a Python software development kit (SDK). Netpicker focuses on network testing, compliance, backups, and Python-based automation, with documented REST APIs. Their roles differ: Slurp’it supplies network data; Netpicker validates and automates network operations; AAP can provide general automation execution and orchestration.

Rather than compare Flock9’s Slurp’it and Netpicker with Ansible/AAP, I want to focus on one practical use case I find compelling: using TextFSM to turn command-line interface (CLI) output into structured data. In Ansible/AAP, ansible.utils.cli_parse applies a TextFSM template as one step in a playbook-based automation workflow, as described in the Ansible CLI parsing documentation.

Ansible Lightspeed can help generate Ansible tasks and playbooks from natural-language prompts (Red Hat documentation). However, its documented capabilities do not describe a built-in, network-specific workflow that takes raw show-command output and directly generates a TextFSM template or structured JSON. Custom or third-party AI integrations may be possible; those are distinct from the standard cli_parse workflow.

Slurp’it’s TextFSM workflow starts from the network output teams care about: The output of any show command can be turned into structured data they can use. Its AI-integrated TextFSM Template Builder can generate a template starting point from raw CLI output; teams can test and refine it for their environment, then add it to a “collection plan” for repeatable collection. That makes the approach adaptable to the commands a team needs, rather than confining it to a fixed set of predefined outputs.

Slurp’it’s separate AI Agent is positioned as a way to ask questions about that collected data. Both approaches can use TextFSM, and TextFSM doesn’t belong to Slurp’it. The difference is where the work sits: parsing as a step inside broader Ansible/AAP automation, or a flexible path from team-selected CLI output to repeatable structured network data.

Ansible/AAP CLI parsing and AI-assisted template building for network discovery.
Two TextFSM workflows: Ansible/AAP cli_parse uses a TextFSM template to produce parsed output; network discovery workflow connects raw CLI output to template building, testing, collection planning, and structured data. Both can use TextFSM; Slurp’it packages template building with planned network collection.

What changes as network automation workflows span more systems

Many teams begin by automating a specific task: Deploy a configuration, collect operational data, or run a consistent procedure. Over time, they may want to connect that task to a source of truth, validate the intended change, request approval, coordinate across vendors, check post-change health, and report the result to another system.

At that point, the challenge is often the workflow surrounding the device operation: how information moves, how decisions are made, and how each step is controlled. Teams can address this in different ways: Extend Ansible and AAP using their workflow and integration capabilities, introduce Python for custom application logic, or combine the approaches. The right choice depends on fit, maintainability, and operational requirements.

Blank matrix comparing Ansible/AAP, Slurp’it, and Netpicker across scope, approvals, audit trail, and change safety.
Run the same scenario across all three; record supported controls, edition or integration requirements, and gaps, without assuming a winner.

Python can be a good fit when custom logic, data transformation, API integration, testing, or reusable services are central requirements. Netpicker’s Python-based tests and automation, paired with Slurp’it’s API-accessible network data, illustrate how Python can support network workflows. Keep successful playbooks in place, and use Python for components where its libraries or application patterns simplify the workflow.

For API-heavy or data-rich workflows, compare the API access, Python extension points, and orchestration options across AAP and network-specific tools in a proof of concept. Evaluate documentation, authentication, versioning, error handling, auditability, and integration behavior. The choice should account for implementation speed as well as testing, security, maintainability, and operational support.

People, culture, and skills shape the path

Tool fit is only part of the decision. Consider organizational readiness from the engineers doing the work to the leaders setting priorities. Are network engineers comfortable with version control, YAML, APIs, or Python, or would those be new skills to develop? Do leaders prioritize reducing toil, improving consistency, strengthening change controls, or accelerating delivery? An approach that fits neither the team’s current practices nor its capacity to learn may struggle, even if the technology is capable.

Take stock of existing strengths and gaps and plan a realistic path for adoption: Build on skills the team already has, create safe opportunities to practice, and make time for training and peer learning. The goal is to match the approach to the outcomes the organization wants and help the team grow into it, without requiring every network engineer to become a software developer or choosing tools based only on today’s skill set.

Think evolution, not rip and replace

A practical architecture does not have to choose one tool for everything. It can put workflow logic, integrations, and validation in a layer that fits the network automation team’s requirements, then uses the right execution mechanism for each task:

  • Use AAP where its job execution, workflow, and governance capabilities fit; retain successful investments and extend them where useful.
  • Use Slurp’it where continuous discovery and structured network inventory are needed; consume that data through its API or Python SDK.
  • Use Netpicker where Python-based testing, compliance, configuration backup, or network automation fits the use case; integrate through its REST API.
  • Add Python services or scripts for custom orchestration and cross-system logic where they provide clear value.
  • Apply consistent controls across every path: source-of-truth data, testing, approvals, pre- and post-change checks, rollback planning, and audit records.

A custom portal can make sense when operators need an experience tailored to their workflow. But a custom interface also becomes something the organization must secure, maintain, and support. If the existing platform interface meets the need, building another one may add cost without adding value.

Agentic AI depends on trustworthy network data

Before adopting agentic AI in network operations, teams need a dependable data foundation. At minimum, that means solid, current inventory and structured, machine-readable information about device identity, role, topology, services, configuration or intent, ownership, and relevant relationships. An agent is only as useful as the context it can retrieve; stale or inconsistent records can lead it to reason from an inaccurate picture of the network.

That makes inventory and structured data an operational prerequisite, rather than a cleanup task to defer until after introducing agents. Teams should be able to identify authoritative sources, normalize identifiers, track freshness and origin, and reconcile declared inventory with observed network state. Where data confidence is low, workflows should surface that uncertainty and stop or request review rather than silently act.

Flowchart showing how trusted data leads to validated AI actions; uncertain or stale data stops the workflow for human review.
Trust data before agents act: Trusted data supports a bounded agent task and result validation; uncertain data stops and routes to human review. Proceed with bounded tasks only when the data is trustworthy; stop and review when it is not.

Once the context is dependable, teams can consider agentic AI for bounded tasks such as correlating state, identifying deviations, recommending next steps, and invoking approved actions. Production use still needs scoped permissions, validation, human oversight where appropriate, and auditability. These requirements apply whether the execution layer is Ansible, Python, or both.

Start with the workflow, then choose the tools

Before expanding an automation solution, it helps to ask:

  • Which repetitive or error-prone workflows consume the most engineering time?
  • Where do teams lose time moving data or approvals between systems?
  • Which existing Ansible jobs and platform controls should remain in place?
  • Which needs are well served by Ansible/AAP today, and where would Python or a specialized network tool materially improve the workflow?
  • What validation, approval, rollback, and audit requirements must apply to every execution path?

The answers can point to a phased roadmap: Strengthen a few high-value workflows first, reuse what is already effective, and introduce new components only where they solve a defined operational problem.

GDT works with network automation teams to assess their current automation environment, prioritize practical use cases, and shape a multi-vendor roadmap. A focused workshop can identify the workflows well served by Ansible/AAP, where Slurp’it and Netpicker could fit, and where Python may improve integration or workflow design, all without disrupting what already works. To explore your options, talk with a GDT expert.

Sources

Share this article

Author

Mike Saur

Mike Saur is a senior solutions architect at GDT, focused on helping organizations modernize operations through automation, software innovation, and AI-enabled workflows. He partners with customers, engineers, and technology providers to create scalable solutions that improve efficiency, enhance visibility, and simplify day-to-day operations. Mike brings more than 20 years of experience spanning solution architecture, automation, infrastructure, and technology consulting. Away from work, Mike enjoys traveling, discovering new music, martial arts, and exploring emerging technologies. Mike is the proud father of two adult children and is passionate about continuous learning, innovation, and finding practical ways to apply technology to real-world challenges.

You might also like:

Blog
Can your data center handle AI? What has to change from a traditional design
Blog
AI factory strategy: How to decide where AI workloads should run
Blog
A look inside GDT’s new AI Factory Center of Excellence
Blog
Avoiding OEM sticker shock: How fragmented contracts impact renewal costs