NetDevOps
IaC
  • Introduction
  • Dev Setup
  • NDFC
  • REST API
  • Python
  • Ansible
  • VXLAN as Code
  • NetDevOps
  • Bonus: Terraform
  • Bonus: Postman
  • Reference: More Ansible

IaC relies on practices that have been successfully used for years in software development. A Version Control System (VCS) like Github/GitLab is a vital part of IaC. It provides a way to track changes and easily merge or revert changes. Most VCSs have CI/CD pipeline systems built-in which can be used to test your code and configuration before deploying it on the production network. There is a wide range of tools available which can be used to serve this purpose. in this lab, we will be using GitLab.

Whenever there is a code or config change it's a good idea to follow these general sets of steps:

  1. Changes should always be made in a staging branch before they go into the production branch
  2. In the staging branch, make changes and commit the code/config and then open a merge request against the production branch
  3. The CI pipeline is triggered to test/validate the code/config changes on your staging environment
  4. Assuming the CI pipeline succeeds, the changes can be merged back to the production branch
  5. Merging to the control branch triggers the CD pipeline to deploy the changes to your production environment




NOTE: When using NX-OS, the staging environment can be simulated using Nexus 9000v virtual switches before deploying to your production environment.

Now that you have a high level understanding of CI/CD, let's build it out!

Step 1 - Login to GitLab

Login to the GitLab instance by clicking the URL below or copying the URL into a new tab in your browser window:

Login using the information below:

  • Username: pod09
  • Password: c1sco.123
  • Then click Sign in




Step 2 - Review Empty Lab Repository

Once logged into GitLab, your screen should look similar to the screenshot below. This is what an empty Git repository (repo) looks like in GitLab as well as in GitHub if you were to use that for source control. Empty repos provide you the steps and information to initialize and commit code to the repo. This will be the action you perform in the next section.


Continue to the next section to initialize your GitLab repo and create files for the CI/CD pipeline to access your production fabric.