The Multi-Vendor Network Automation training offers five hours of use case based training to become familiar with using the Ansible Automation Platform (AAP) for Network automation. This repository includes eight "immersive" network automation exercises. This training is designed to enhance your team’s knowledge, skills, and confidence with using Ansible Automation Platform (AAP) for networks.
The main focus of this workshop is to automate real world use cases using the power and capabilities of the Ansible Automation Platform.
This training is not focused on extensive playbook development. Although we examine existing playbook content and best practices, there are minimal modifications.
-
Network Automation 101 workshop https://labs.demoredhat.com/webpages/network
-
Network Automation advanced workshop https://github.com/mglantz/advanced-networking-workshop/tree/main?tab=readme-ov-file
Please note, the lab pods for these exercises can be accessed on your behalf by Red Hat employees.
Ask your RH account representative to schedule an instuctor to make a RHDP reservation for an aap2-workshop-networking-automation POD https://demo.redhat.com/catalog?search=network&item=babylon-catalog-prod%2Fansiblebu.aap2-workshop-networking-automation.prod
During the workshop your instructor will provide a link similar to the following:
http://jxqdn.example.opentlc.com
You will be prompted for your name and email address. Afterwards, your browser is redirected to your workbench.
Note, the password is the same for ssh, VSCode, and the Ansible Controller. Remember to leave this browser tab open incase you need to copy the password again at various exercises throughout the duration of the workshop.
Upon receiving a student workbench, please scroll down directly to the Exercise 0 Getting Started
steps or click below.
For the below demos ensure you are always using files from /home/student/network-demos-repo/
- 1-Backups As Code
- 2-Network Compliance Dashboard
- 3-Network Compliance Checks Remediations
- 4-Multivendor Validated Content (BGP)
- 5-Brownfield Switches Resource Modules
- 6-Network Upgrade As Code
- 7-Tuning For Scale
- 8-Config Drift Restore
This exercise will set up your environment for the remaining exercises included in this repository. This exercise includes steps to set up a version control system, which is used to track and provide control over changes made to the automation code. Version control (sometimes called source control) plays an important role in any development project, including automation development.
The lab topology includes the following routers:
- rtr1 (cisco ios-xe)
- rtr2 (arista eos)
- rtr3 (juniper junos)
- rtr4 (arista eos)
You must use Visual Studio Code to setup the demos. Visual Studio Code provides:
|
---|
-
Connect to Visual Studio Code from the Workshop launch page (provided by Red Hat RHDP). The password is provided below the WebUI link.
-
Type in the provided password to connect.
We are going to run our first playbook here, which will deploy a Gitea server in a container on the control node (ansible-1).
In the VSC terminal, use wget to download the gitea.yml file, and then use ansible-navigator
to run the playbook.
wget https://gitlab.com/redhatautomation/multi-vendor-network-workshop/-/raw/main/gitea/gitea.yml
You can run the ansible-navigator command with low verbosity, or if you want to see more of what Ansible is doing, you can add -v
(up to 4 v's) to the ansible-navigator command.
ansible-navigator run -m stdout gitea.yml
Running the gitea.yml playbook will output to the terminal all of the tasks that are done to deploy the Gitea container, configure it for use in the environment, and setup the network-demos-repo that we will be working from. When the playbook has finished running, you should be able to update your VSCode window and change into the network-demos-repo directory and run git status to see that we are up today.
Click on the files icon in the upper right corner of your Visual Studio Code window, and click Open Folder
.
In the pop-up window, choose the /home/student/network-demos-repo
folder, and select OK
.
-
If not already there, ensure there is a terminal window open to the
network-demos-repo
directory -
Open a new CLI terminal
The setup.yml playbook will require extra variables when running in ansible-navigator.
- The CONTROLLER_PASSWORD in setup.yml is the same password assigned to your RHDP student POD for the Ansible Controller
Run the ansible-navigator
command with the run
argument and -m stdout as well as -e for the --extra-vars
ansible-navigator run 0-controller_as_code/setup.yml --eei registry.gitlab.com/redhatautomation/validated-network-ee:latest -m stdout -e "username=gitea git_password=gitea password=<replace-with-lab-student-password>"
The first run will show 'changed'
PLAY [Playbook to configure ansible controller] ********************************
TASK [Gathering Facts] *********************************************************
ok: [localhost]
TASK [Create projects] *********************************************************
ok: [localhost]
TASK [Add group] ***************************************************************
ok: [localhost]
TASK [Add group] ***************************************************************
ok: [localhost]
TASK [Add group] ***************************************************************
ok: [localhost]
TASK [Create Execution Environments] *******************************************
ok: [localhost]
TASK [Gitea Credential Type] *******************************************************
ok: [localhost]
TASK [Gitea Credential] *******************************************************
ok: [localhost]
Access your AAP from the https://xxxxx.example.opentlc.com/ link.
- Your link is included with the RHDP pod information.
Your AAP Controller should now include the job-templates etc for the menu of demos. You can now select a demo from the Menu of Demos and follow the specific directions in the README.md.