Chapter 1 What is Network Automation?

For diagrams, tables, or exact code formatting, .

JOHN W. CAPOBIANCOPRINTED PAGE 19

 Microsoft Visual Studio Code (VS Code).  Microsoft Team Foundation Server (TFS).  Linux.  Git.  Ansible.  A central code repository in TFS.  A local code repository for development in VS Code.  A local code repository on the Linux / Ansible host to execute playbooks.  A master branch.  Working branches.  A hosts.ini file.  Data models (Ansible group_vars and host_vars, YAML files holding variables).  Dynamic templates.  Tasks.  Playbooks.  The YAML file format and syntax.  The Jinja2 file format and syntax.  Python skills, ideally, but not required for Ansible beginners.

Converting Configurations to Code The goal is to transform the network from a series of interconnected but unrelated and independently configured devices, to a holistic application-like system. Start by collecting relevant data from the existing network. Abstract meaningful data from the configurations and then convert that data into a model. The network should follow a standard core, distribution, and access layer architecture. A solid IP address plan should already exist, and the network should follow some basic conventions and standards. If the network is built on these foundations, converting it to code should be quite simple.

It should be noted that if the network is chaotic in nature and lacks basic standards it may be easier to start from scratch and approach it as a greenfield. Standards and conventions can be enforced using automation. Start by developing models and templates and address the lack of standards on the network as a starting point. Remember garbage-in, garbage-out.

If the network is relatively standardized, collect the running-configurations from the core, a distribution switch, and an access switch. Try to find devices that represent a standard deployment that can be modeled after and templated from. Extract and separate the important information from the configuration commands. The important information will become variables that go into data models and the configuration commands will go into templates. Meaningful data can include:

 Standard global configuration information:

o AAA information. o QoS policies. o SNMP information. o Logging information. o NTP information. o Archive information.  Hostname.