CCNA lab 38 of 46
Automating IOS with Ansible
Prepare two routers and a switch for automation, then use Ansible from a Linux control node to run show commands everywhere at once, push a baseline that proves idempotency, create a VLAN with a resource module and read device facts as JSON.
Run this lab
It needs Lite: its 4 nodes are set to 4 vCPU and 4,096 MB in total. That fits the free demo too.
In your workspace: Shared, then CCNA 200-301 guided labs, then 38 - Automating IOS with Ansible
- Level
- Intermediate
- Time
- About 60 minutes
- Nodes need
- 4 vCPU, 4,096 MB
- Smallest plan
- Lite
The scenario
Fenmoor Housing's three-person network team spends Mondays logging in to every device to make the same small changes. They want the routine work automated with Ansible, which they can run from a Linux machine (CTRL) without installing anything on the routers. You'll prepare the devices, then run commands and changes across all of them at once.
| Device | Address | Ansible group |
|---|---|---|
| R1 | 10.38.0.1/24 | routers |
| R2 | 10.38.0.2/24 | routers |
| S1 | 10.38.0.3/24 | switches |
| CTRL | 10.38.0.100/24 | control node (project in /root/ansible) |
What you’ll practise
- Explain how automation changes network management, and compare Ansible, Terraform, Puppet and Chef
- Prepare IOS devices for agentless automation over SSH
- Read an Ansible inventory, group variables and a playbook written in YAML
- Run ad hoc commands and playbooks with the cisco.ios collection
- Show idempotency and read gathered facts as JSON
The tasks
- Know why and with what
- Prepare the devices for automation
- Read the project
- Run ad hoc commands everywhere
- Push a baseline with a playbook and prove idempotency
- Use a resource module to create a VLAN
- Read facts as JSON
The Lab Tasks pane has the scenario, these tasks, the checks to run, hints and the full solution.
Topology and devices
The network as it opens in EVE-NG, drawn from the lab’s own canvas, and the image each node runs.
Every link, as text
- R1
Gi0/0to S1Gi0/0 - R2
Gi0/0to S1Gi0/1 - CTRL
eth0to S1Gi0/2
| Node | Device | Image in Add Node | Set to |
|---|---|---|---|
| R1 | Cisco IOSv | vios-adventerprisek9-m.SPA.159-3.M6 | 1 vCPU, 1,024 MB |
| R2 | Cisco IOSv | vios-adventerprisek9-m.SPA.159-3.M6 | 1 vCPU, 1,024 MB |
| S1 | Cisco IOSvL2 | viosl2-adventerprisek9-m.ssa.high_iron_20200929 | 1 vCPU, 1,024 MB |
| CTRL | EVE-NG GUI server (Docker) | eve-gui-server:latest | 1 vCPU, 1,024 MB |
How to open this lab
Sign in to your workspace at
lab.cloudlabbox.com.In File Manager, open Shared, then the folder
CCNA 200-301 guided labs.Open
38 - Automating IOS with Ansibleand start its nodes, then open Lab Tasks for the scenario and the steps.
The lab is read-only. You can start the nodes and configure the devices, but changes to the topology can’t be saved. To change it, rebuild it in your own folder.
More CCNA labs
Related labs in other courses
CloudLabBox is independent of Cisco. The lab follows exam topics and isn’t vendor training material; vendor names identify the exams and the images in the workspace.