Network automation

Automation frameworks

 

Getting started

Brief comparison of automation frameworks - https://forums.juniper.net/t5/Tech-Cafe-Ask-the-Author/SaltStack-Napalm/m-p/296413#M35

Automating your network operations blog: basic challenge, data model, model-driven automation

Many links on "Awesome Network Automation" - https://github.com/networktocode/awesome-network-automation

 

Ansible

Automation engine written in Python. Acquired by RedHat

Links: homedocsnetworkingnetwork modules, shared Ansible roles on Ansible Galaxynapalm-ansible, network platforms tested by RedHat

AWX "provides a web-based user interface, REST API, and task engine built on top of Ansible. It is the upstream project for Tower, a commercial derivative of AWX".

How to automate your network with Ansible and NAPALM: part 1, part 2, part 3, part 4

Community: network working group

Running Ansible programmatically:

Major changes: networking in 2.4; 2.5, porting guide, new connection plugin

Also: command module deep dive

Pulumi

Infrastructure-as-a-Code SDK for Go, Python, TypeScript, etc. For multi-cloud and Kubernetes automation.

Links: home, GitHub

Terraform

Infrastructure-as-a-Code tool mainly used from CLI. For multi-cloud automation.

Links: home, Terragrunt (Terraform wrapper)

GitHub: Google Cloud Modules, SDK

Saltstack

Automation framework written in Python

Links: homedocswalkthroughnetwork automation at scale booknapalm-saltproxy modules.

Mircea Ulinic: bloggithub

Networking help/advice: https://networktocode.herokuapp.com/, rooms: #saltstack #napalm

Salt in general irc: #salt on freenode; Google groups: salt-users

Tutorials: NetOps with SaltStack and PyNSO

 

Nornir

Automation framework from developers of key network automation libraries. "Intended to be used directly from Python".

GitHub, Docs


 

Vendor-neutral tools and libraries

NAPALM

About: 'NAPALM (Network Automation and Programmability Abstraction Layer with Multivendor support) is a Python library that implements a set of functions to interact with different router vendor devices using a unified API'. Also works with YANG, " provides mechanisms to transform native data/config into YANG and vice versa".

Integrated with natively with SaltStack and Ansible via module

Links: homeGitHubdocs

NetBox

About: "Web application designed to help manage and document computer networks. Initially conceived by the network engineering team at DigitalOcean."

Links: GitHub, docs

Capirca

About: "Development and manipulation of network access control lists (ACLs) for various platforms". Originally developed by Google.

Links: GitHubwikipypisyntax highlighting for Capirca filetypes in Atom

Netmiko

About: 'An open-source Python library that simplifies SSH management to network devices. The library is based on the Paramiko SSH library'

Links: HomeGitHub

TextFSM

About: "Allow programmatic access to information returned from the command line interface (CLI) of networking devices". Originally developed by Google.

Links: GitHub, NTC-Templates ("set of multi-vendor templates"; "these templates take the raw string input from the CLI and return structured text in the form of a Python dictionary".), index

FBNet Command Runner

About: Facebook's tool to run commands on many network devices from many vendors in parallel

GitHub - FCR

Related blog post

More libraries

ncclient - "Python library for NETCONF clients"

jxmlease - "A Python module for converting XML to intelligent Python data structures, and converting Python data structures to XML"

pexpect - "Pexpect allows your script to spawn a child application and control it as if a human were typing commands. Pexpect can be used for automating interactive applications such as ssh, ftp, passwd, telnet, etc."

pyang - "An extensible YANG validator and converter in python"

reclass -  "Allow a system administrator to maintain an inventory of nodes to be managed, completely separately from the configuration of the automation tool. Usually, the external node classifier completely replaces the tool-specific inventory (such as site.pp for Puppet, ext_pillar/master_tops for Salt, or /etc/ansible/hosts). Links: docsgithub

Python XML (advised by pynet.twb-tech.com):


Vendor-specific tools and libraries

Juniper

GitHub: JuniperJNPRAutomateautomation examplesPyEZpy-junos-netconify; Google groups: PyEZ; OpenClos

Cisco

GitHubpyIOSXRCiscoConfParsenxapi-learning-labsXR AnsibleNX-OS AnsibleTail-f ConfDOpen NX-OSNetOps with SaltStack and PyNSO, PyNSO, pipelineNetConf examples;

Cisco on GitHub with different programming languages: Python, Golang

Itential - a product used on top of NSO for some use cases - https://www.itential.com/

Arista

GitHubpyEOSEOS+

Nokia (Alcatel-Lucent)

NETCONF in SR-OS

Hewlett-Packard Enterprise

GitHub (generic non-networking), HP Networkingscripts