mglantz / advanced-networking-workshop

Advanced Ansible network automation workshop

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

advanced-networking-workshop

Hello and welcome to this more advanced Ansible workshop on the topic of network automation.

Scroll down past the overview if you want information about how to install this workshop.

💥 If you are a person who are performing this workshop, click on the link of Section 0: Instroduction to the lab.

❗ If you find any issues, please consider to contribute a fix.

Overview of lab excercises

0.1: Introduction to the workshop
0.2: Technical prerequisites
0.3: Knowledge prerequisites
0.4: What this workshop is NOT about
0.5: Lab graphics
0.6: If something goes wrong
0.7: Preparing to do the lab
0.8: Accessing the lab for the first time
1.1: Different Ansible approaches to automating network devices
1.1.1: Vendor differences
1.1.2: Network test automation (using ContainerLab)
1.1.2.1: Creating a containerlab test environment
1.1.3: Gathering information
1.1.3.1: Using the command module
1.1.3.2: Performing backups
1.1.3.3: Documenting your network
1.1.3.4: Adding intelligence to your playbooks
1.1.3.5: Operational use-cases
2.1: Building a new containerlab environment
2.2: Reviewing the initial desired configuration state
2.3: Using the command module to accomplish our desired state
2.3.1: Assessing the use of the command module.
2.4: Learning about purpose specific configuration modules
2.4.1: module state: "merged" (often the default)
2.4.2: module state: "replaced"
2.4.3: module state: "overridden"
2.4.4: module state: "deleted"
2.4.5: module state: "gathered"
2.4.6: module state: "rendered" / "parsed"
2.5: Reset your lab environment
2.6: Using purpose specific modules to archieve the desired configuration state
2.6.1: Assessing the use of purpose specific configuration modules
2.7: Using config modules to make changes
2.7.1: Using the config module to load static config files into devices
2.7.2: Using the config module to inject lines of config into devices
2.7.3: Using the config module to load dynamic config files into devices
3.1 Review of containerlab and desired state device configuration
3.2 Automating your network
3.3. Validating your setup

Installation of lab infrastructure

❗ Below instructions are only for people who need to install the lab environment themselves, not for people who are students in a pre-setup workshop. ❗ The playbooks in the provision directory are for setting this workshop up at scale on AWS and may have to be adjusted if you are to use them. Below instructions allows you to setup this workshop on a local system, without a VScode instance.

To get the containerlab setup working on Fedora 39 or Red Hat Enterprise Linux 9.4, using podman:

  1. Install podman
$ sudo dnf install podman podman-docker git ansible
  1. Start podman services:
$ sudo systemctl enable podman --now
  1. Install containerlab and configure it to work with SELinux
$ sudo bash -c "$(curl -sL https://get.containerlab.dev)"
$ sudo semanage fcontext -a -t textrel_shlib_t $(which containerlab)
$ sudo restorecon $(which containerlab)
  1. Download the cEOS 4.32.0F container image from Arista

  2. Do a podman import on this image (yeah, needs to be done as root, as containerlab requires things to be run as root).

$ sudo podman import cEOS64-lab-4.32.0F.tar.tar ceos:4.32.0F 
  1. Clone this repository into your /home/user directory
cd ~
git clone https://github.com/mglantz/advanced-networking-workshop
  1. Configure environment
$ export LABDIR="$HOME/advanced-networking-workshop"
$ eval $(ssh-agent -s)
$ cp $LABDIR/scripts/id_rsa ~/.ssh/adv-networking
$ chmod 600 ~/.ssh/adv-networking
$ ssh-add ~/.ssh/adv-networking
  1. Do a test start of a containerlab
cd $LABDIR/containerlab
sudo containerlab --runtime podman deploy -t solutions/lab1.yml
  1. Validate setup by accessing the switches.
ssh admin@IPv4-address-of-switch
# User/password is: admin/admin but you should be automatically logged in via your ssh key.
  1. Now you are ready to start the lab. Goto lab-0/README.md.

About

Advanced Ansible network automation workshop

License:GNU General Public License v3.0


Languages

Language:Jinja 53.6%Language:Shell 46.4%