In this section we are going to show you the complete integration that you built to push changes in the Ansible data structures that will then push the configuration to the ACI fabric.
From a top level view the diagram to the right shows what you will perform following and would be the standard way of pushing configuration changes into the ACI fabric utilizing this method that is also known as Infrastructure as Code. All changes go through the SCM (GIT) to be evaluated, verified and then pushed into production.
This is software disciplines applied to the network infrastructure.
For the next steps proceed to the Visual Studio Code IDE interface.
In this step you will add a new EPG into your configuration files that are
now part of this GIT repository.
In the editor find the file main.yml
under the roles/apic/tasks
directory and open it by
double-clicking on it. We are going to make a simple silly change by adding a new EPG called database2
that will allow us to see the complete flow of changes from the SCM to the ACI fabric.
- name: Create Database2 EPG
cisco.aci.aci_epg:
ap: "POD04_APP"
bd: "database"
epg: "database2"
description: 'POD04 Database2 EPG'
state: present
tenant: "{{ tenant }}"
You now have to commit the changes into the GIT.
git commit -a -m "Add new EPG"
And now you can run the git push command to push the changes into the repository.
git push
And this should push these changes into the repository server.
For the next steps proceed to the GitLab web page interface.
In the GitLab webpage interface:
You need to click on </> Code menu to select the Merge Requests option which will present you with the screen below.
For which you will click on the New merge request button.
Then the following screen will be presented to you. You will select the develop
branch as the source
branch and the main
as the target branch. Then click on the Compare
branches and continue button.
Add new EPG
and then click on the Submit merge
request.
And click on Merge to complete.
You can click on the pipeline number to follow the execution
Click on the pipeline link to see the execution of the pipeline.
When you click on deploy it will present the log of the execution of the pipeline.
In the logs of the execution you shoud see that ansible now ran and detected that it needed to make a change in ACI to push the configuration change that was defined in code.
You can see that the TASK shows as changed
which means that it did a change in the ACI fabric.
You should see in the log that Ansible did a change for the database2 EPG.
TASK [apic : Create Database2 EPG] ********************************************* changed: [apic] PLAY RECAP ********************************************************************* apic : ok=10 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0