Chapter 1 What is Network Automation?

For diagrams, tables, or exact code formatting, .

JOHN W. CAPOBIANCOPRINTED PAGE 22

type: SECURITY description: Standard Security Interface vlan: 50 state_enabled: true Templates Templates are human-readable Jinja2 files made up of logical operators, dynamic variables and static text. Once combined with group and host variables each device receives a unique configuration derived from and based on the dynamic templates. The spacing of the text, syntax and unique platform variations of text all need to match a device’s running-configuration. Templates ensure that intentions are defined and that golden configurations on all devices adhere to the standards.

Here is a sample template, in the Jinja2 format, to configure VLANs on a device: vlan {{ global_campus_defaults.native_vlan }} name NativeVLAN {% if host_vlans is defined %} {% for host_vlan in host_vlans %} vlan {{ host_vlan }} name {{ host_vlans[host_vlan].name }} {% endfor %} {% endif %} Methodology Some of the biggest changes that network automation brings is the new methodology available now that the network has become application-like and is comprised of standard human-readable code. Instead of network engineers drafting configuration changes and network operations deploying to production at the CLI, they can follow a CI/CD pipeline with change management, version control and a branching strategy. Documentation will move to TFS as it becomes automated along with the configurations of the devices. Reviewing pull requests and Git commits will become part of the routine for network engineers as they peer review and approve changes to the master branch. The SDLC approach to software development should already exist in the organization. An opportunity exists to bridge IT with software development which adopts already existing code standards and development policies for the new network automation code. Initially, network engineers will write Ansible playbooks that operations will execute as a one-line command at an approved schedule. Eventually these steps become automated through the CI/CD pipeline.

Network Development Lifecycle (NDLC) A network development lifecycle can be adopted to help provide a high-level vision and guidance around network development. A framework for the branch structure is required. Developers need to perform Git commits frequently checking-in their code often. A common data model format needs to be:

 Followed uniformly by all developers.  Naming conventions established.  Standardized templates and programmatic code formats developed.  Code should include comments.