Chapter 4 Where to Start with Network Automation?
For diagrams, tables, or exact code formatting, .
Large-scale feature deployments. Large-scale corrections. Single, one-time changes. Configuration management. Ansible Module – ios_config
Building on the ios_command module, a new Ansible module - ios_config - is used to perform changes on Cisco Catalyst devices running IOS. Think of the ios_command module as a tool used in EXEC mode on a device that is able to perform standard show commands or copy running- configuration startup-configuration commands performed at the user EXEC level of IOS.
In contrast the ios_config module can perform privileged EXEC level commands used for device configuration. The ios_config module is used to execute commands that make changes on the network.
More on the ios_config module can be found here: https://docs.ansible.com/ansible/latest/modules/ios_config_module.html
Chapter 7 provides examples and expands on ios_config utilization to automate tactical one-time plays.
Configuration Management
Ultimately the goal of network automation is to provide complete coverage of all network configurations and required changes to those configurations. One-time tactical playbooks are incredibly powerful however, these playbooks are simply moving the execution of CLI commands from human input to an automation engine. While network reconnaissance and executing tactical commands can be performed at scale, full network configuration management has not yet been achieved because no source of truth exists. The network is not yet intent-based since there is no automated provisioning. The powerful dynamic templating engine has not been put into use.
Automated documentation and configuration management involves the abstraction of data from network configurations. Data models are built around the relevant information a device contains. The actual configuration commands are then transformed into templates. Variables are substituted with information contained in the data models at run time making the templates dynamic. Standardized golden templates ensure configuration consistency derived from intent is applied at scale.
Expand on the utilization of the ios_config module to automate network configuration management. For the most part code will continue to be written as YAML files, but now Jinja2 templating is introduced to hold the mix of programmatic logic and static commands to build new templates.
The process can be done in any order but here are the building blocks needed to automate network configuration management:
Create variables in data dictionary:
o group_vars. o host_vars.
