Chapter 10 Configuration Management

For diagrams, tables, or exact code formatting, .

JOHN W. CAPOBIANCOPRINTED PAGE 178

src: ../../templates/configurations/ios/ dest: '../../templates/configurations/ios_combined/assembled-config-campus.j2' check_mode: no delegate_to: localhost run_once: true - import_tasks: ../../tasks/configurations/ios/assembled-config-campus.yml - import_tasks: ../../tasks/configurations/ios/ios_copyrunstart.yml Observe the playbook in action: ansible-playbook assembled-configuration-campus.yml –v –limit DIST01 TASK [Assembled IOS Configuration for Campus] **************************************** changed: [DIST01] => {"banners": {}, "changed": true, "commands": ["vlan 3999", "name Demo_vlan"], "updates": ["vlan 3999", "name Demo_vlan"]} TASK [Copy Run Start] **************************************************************** ok: [DIST01] => {"changed": false, "stdout": [], "stdout_lines": []} PLAY RECAP *************************************************************************** DIST01 : ok=5 changed=1 unreachable=0 failed=0 Assembling the Ansible tasks has dramatically improved the performance and efficiency while still achieving the same goal. This assembled-configuration-campus.yml playbook can be scheduled for continuous deployment while the configuration-campus.yml playbook can be used for more granular executions. Using check mode the serially executed playbook can be used to capture the changes as part of the change request while at execution time the assembled playbook is run.

Execute Playbooks – Serial or Assembled Campus Configuration The full network configuration management has been automated and either the configure- campus.yml or assembled-configuration-campus.yml playbook will now be able to configure every feature and setting on each device across the network. This can be a highly disruptive play so before executing it live make sure to run the playbook in check mode several times against several devices. Achieving idempotency might mean manual changes (making changes to the device to match your new intent) or at least having an understanding of all the changes the playbook will make when it runs in execute mode. The playbook will gather facts, push assembled configurations, and write the device memory to commit the change to the startup-configuration. Moving Forward

Ideally, a fully automated, fully idempotent, network configuration management system has been achieved and has revolutionized internal processes. The organization is now following an NDLC using a centralized repository and branching strategy. All network reconnaissance, tactical changes, and network configuration management are fully automated. So, does this mean the job is done? Not quite.