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

Try it free for 30 minutesRun it on Lite from £3 a day

The free demo needs no card and no email. Every lab plan includes every guided lab.

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.

DeviceAddressNotes
NETOPS10.99.0.10/24Ubuntu desktop (open its console for RDP; log in as root, password eve). Ansible and Git are installed.
R1, R2, R310.99.0.1, .2, .3 /24 on Gi0/0IOS 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

  1. Bootstrap the routers for automation (day 0)
  2. Meet the Ansible project
  3. Put the project under version control
  4. Apply the standards, twice
  5. Make a change on a branch
  6. 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.

Topology of Infrastructure as code with Ansible and Git4 nodes and 1 network, 4 links. Every link is listed as text below the diagram.NETOPSR1R2R3MGMTeth0Gi0/0Gi0/0Gi0/0
4 nodes and 1 network, with the interface names each link uses. On a narrow screen, scroll the diagram sideways.
Nodes in Infrastructure as code with Ansible and Git, with the image each runs and the vCPU and RAM it’s set to
NodeDeviceImage in Add NodeSet to
NETOPSEVE-NG GUI server (Docker)eve-gui-server:latest1 vCPU, 2,048 MB
R1Cisco IOSvvios-adventerprisek9-m.SPA.159-3.M61 vCPU, 512 MB
R2Cisco IOSvvios-adventerprisek9-m.SPA.159-3.M61 vCPU, 512 MB
R3Cisco IOSvvios-adventerprisek9-m.SPA.159-3.M61 vCPU, 512 MB

How to open this lab

  1. Sign in to your workspace at lab.cloudlabbox.com.

  2. In File Manager, open Shared, then the folder CompTIA Network Plus N10-009 guided labs.

  3. Open 23 - Infrastructure as code with Ansible and Git and 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

All 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.