Network+ lab 23 of 27
Infrastructure as code with Ansible and Git
Manage three routers as code from a NetOps workstation. You bootstrap SSH, keep an Ansible project in Git with a central repository, apply device standards with a playbook, make a change on a branch, catch and fix configuration drift, and back up the configurations.
Run this lab
It needs Lite: its 4 nodes are set to 4 vCPU and 3,584 MB in total. That fits the free demo too.
In your workspace: Shared, then CompTIA Network Plus N10-009 guided labs, then 23 - Infrastructure as code with Ansible and Git
- Level
- Advanced
- Time
- About 75 minutes
- Nodes need
- 4 vCPU, 3,584 MB
- Smallest plan
- Lite
The scenario
Harbour Logistics now has more routers than one engineer can keep consistent by hand, and an audit found that each one logs to a different place. The team will manage device standards as code: an Ansible project stored in Git, applied from a NetOps workstation, reviewed on branches, and re-run to catch anyone who changes a router by hand.
| Device | Address | Notes |
|---|---|---|
| NETOPS | 10.99.0.10/24 | Ubuntu desktop (open its console for RDP; log in as root, password eve). Ansible and Git are installed. |
| R1, R2, R3 | 10.99.0.1, .2, .3 /24 on Gi0/0 | IOS routers, reachable on the management network |
Standards to enforce: NTP server and syslog host 10.99.0.10, millisecond log timestamps, a login banner, and (later, through a reviewed change) an SNMP location. Automation account (teaching values): netops / N3tops-Lab, privilege 15.
What you’ll practise
- Explain infrastructure as code: playbooks, templates, idempotency, inventories
- Bootstrap devices for automation (day 0) and test Ansible connectivity
- Version a network project with Git: commits, a central repository, branches and merges
- Apply standard configuration with an idempotent playbook
- Detect configuration drift with a check-mode run and remediate it
- Back up device configurations to the repository
The tasks
- Bootstrap the routers for automation (day 0)
- Meet the Ansible project
- Put the project under version control
- Apply the standards, twice
- Make a change on a branch
- Catch configuration drift, then back up
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
- NETOPS
eth0to MGMT (network) - R1
Gi0/0to MGMT (network) - R2
Gi0/0to MGMT (network) - R3
Gi0/0to MGMT (network)
| Node | Device | Image in Add Node | Set to |
|---|---|---|---|
| NETOPS | EVE-NG GUI server (Docker) | eve-gui-server:latest | 1 vCPU, 2,048 MB |
| R1 | Cisco IOSv | vios-adventerprisek9-m.SPA.159-3.M6 | 1 vCPU, 512 MB |
| R2 | Cisco IOSv | vios-adventerprisek9-m.SPA.159-3.M6 | 1 vCPU, 512 MB |
| R3 | Cisco IOSv | vios-adventerprisek9-m.SPA.159-3.M6 | 1 vCPU, 512 MB |
How to open this lab
Sign in to your workspace at
lab.cloudlabbox.com.In File Manager, open Shared, then the folder
CompTIA Network Plus N10-009 guided labs.Open
23 - Infrastructure as code with Ansible and Gitand 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 Network+ labs
Related labs in other courses
CloudLabBox is independent of CompTIA, Cisco and Netgate. The lab follows exam topics and isn’t vendor training material; vendor names identify the exams and the images in the workspace.