Chapter 11 Continuous Integration / Continuous Delivery

For diagrams, tables, or exact code formatting, .

JOHN W. CAPOBIANCOPRINTED PAGE 183

Chapter 11 Continuous Integration / Continuous Delivery “The question of whether a computer can think is no more interesting than the question of whether a submarine can swim.”

― Edsger W. Dijkstra The final phase to network automation is to continuously integrate and deliver the Ansible playbooks into the production network. CI is the software development practice adopted for network automation. CI allows for teams to collaborate on code, integrating their changes often using Git commits and pull requests, and creating automated builds whenever there are changes made to the master branch. CD expands on the CI capability and automatically releases, or pushes, the automated builds to the network on a scheduled release. This schedule could be as frequent as hourly, nightly, or weekly. The general principal of CI/CD is that developers only need to worry about making changes to the code not how to document, integrate, or release it. The CI/CD pipeline and the automation engine takes care of this for them. This often has the side-effect of removing network operations from the equation.

CI

Throughout this book it has been advocated to follow the CI software development model. CI is the practice of merging all developer working copies to a shared repository several times a day. However, at this point in the journey, a hybrid approach of automated playbooks executed by human operators has been used. The execution of the playbooks has replaced the previous steps of copy-pasting network engineer prescribed changes, by network operations staff. Now operators log into a Linux box and execute ansible-playbook commands to generate automated documentation and to perform network configuration management across the enterprise. The next natural step is to automate the execution of the playbooks themselves. Cron jobs or other Linux scheduling techniques can be used to automate the scheduled execution of playbooks however there is a more elegant solution and that is by integrating the playbook execution directly into the TFS CI/CD pipeline.

A great candidate for getting started with CI is the documentation.yml Ansible playbook. This playbook generates the configurations and documentation for the network. Automatically running the documentation.yml Ansible playbook every time pull requests merge changes into the master branch results in living documentation. Network changes now include all relevant and related documentation updates without operator intervention.

Microsoft Team Foundation Server This book is not meant to provide an exhaustive training course on Microsoft TFS but rather to introduce TFS as a code repository and a CI/CD pipeline system. The more advanced and skilled staff become with TFS, the tighter the CI/CD pipeline integration becomes. Be sure to install the Ansible Microsoft Marketplace extension into TFS before continuing.