Avatar

Should you copy code?

It is a much-discussed question and has been since… well, forever! Do you get stuck when writing your network automation code? If you said yes, you won’t be the first and most certainly be the last either. I was asked once when in the DevNet Zone at Cisco Live, “is looking on Google for help with python code cheating?” “No,” was my swift reply, it’s perfectly normal, even now in some job interviews when you have a coding challenge, if you get stuck you are allowed to search for documents and examples. We all get stuck and so we search for an answer. That answer can come from many places – GitHub, blogs, Q&A forums, the very popular Stack Overflow, divine intervention… A great quote I read by Ralph Johnson says, “copy-and-paste code is not necessarily bad in the short run, if you are copying good code.”

Code is good… a use case is better

Some of the most common use cases for network automation are:

  • Device provisioning
  • Information gathering
  • Configuration compliance validation

At Cisco Live 2019, DevNet launched DevNet Automation Exchange. Going one step further than just code, Automation Exchange is a shared code repository which solves use cases for network automation, guiding teams through their own journey with a “walk-run-fly” methodology. In case you are not familiar with this methodology let us take a look.

  • Walk — Get visibility and insights into your networks. This enables use cases such as gathering telemetry and insights from running networks and performing auditing to ensure ongoing security of the network.
  • Run — Activate policy and intent across different network domains. This enables use cases such as providing self-service network operations that comply with security policies and operational guidelines.
  • Fly — Proactively manage applications, users, and devices with DevOps workflows. This enables use cases such as deploying applications in continuous integration and continuous delivery (CI/CD) pipelines while configuring the network in accordance with new application policies.

 

Ready to get started?

DevNet has scheduled a series of webinars that let you tune-in to live discussions covering many of the Use Cases available in the DevNet Automation Exchange. You can find the Use Case of interest to you and register to attend.

For now, let’s take a look at an example from each of the walk, run, fly methodology there is on DevNet Automation Exchange and the DevNet Sandbox which this can be tested on.

WalkFind configuration differences with Cisco pyATS | Genie

Cisco pyATS | Genie includes tools that enable network engineers to capture a snapshot of an environment and compare that snapshot to different configurations. This helps engineers answer one of the most common networking questions: what has changed? Try it on the Multi-IOS Cisco Test Network Sandbox

RunAutomate management and configuration of network devices at scale with Salt plugin

Use the Salt salt-sproxy plugin to automate the management and configuration of network devices at scale, without running Proxy Minions. “salt-sproxy” enables you to manage your infrastructure using Salt, without the need to manage thousands of services. With this approach, you also have access to the Salt REST API, can leverage the event-driven automation, and more, as well as inheriting the usual flexibility and extensibility of Salt.

FlyCisco SD-WAN Ansible Pipeline

Liberating network configuration from being locked inside a collection of individual GUIs and into Infrastructure-as-code (IaC) is an important component to achieving viable NetDevOps. The primary goal of this lab is to illustrate how Ansible enables Cisco SD-WAN configuration to be stored as IaC, making it version-controlled, repeatable and easily integrated with NetDevOps CI/CD processes. Try it on the Multi-IOS Cisco Test Network Sandbox

I think you’ll find this Walk-Run-Fly approach to studying Use Cases to be most helpful.  So, what are you waiting for?  Check out the network automation use cases on DevNet Automation Exchange, and tune in to Use Cases Webinars to learn more and talk with experts.

Join me on August 15, 2019, for the first installation of the Network Automation Use Case series entitled “Getting Started with SD-WAN Ansible Pipeline”. Register Now!

Additional Network Automation & Programmability Resources:

 


Join DevNet to access the learning labs, docs, and sandboxes you need for network automation.

 


We’d love to hear what you think. Ask a question or leave a comment below.
And stay connected with Cisco DevNet on social!

Twitter @CiscoDevNet | Facebook | LinkedIn

Visit the new Developer Video Channel



Authors

Stuart Clark

Senior Developer Advocate Of Community, AWS