Ansible for CCNA: Automate Configuration Across Many Devices

Ansible automates the configuration of many devices from a control node: it reads an inventory, runs a playbook written in YAML and connects over SSH without installing agents. It is one of the configuration management tools the CCNA mentions along with Puppet, Chef and Terraform.

Exam domain: Automation and Programmability · Level: Advanced · Updated on October 17, 2026 · 2 min read

Topology diagram “Ansible for CCNA: Automate Configuration Across Many Devices” with 5 devices and 6 links
Topology: Ansible for CCNA: Automate Configuration Across Many Devices

Edit this template Download .json

Learning objectives

Devices and addressing

DeviceTypeDetails
Control nodeANSAnsible
inventory.ini · playbook.yml
R1RouterManaged
SSH · 10.0.0.1
R2RouterManaged
SSH · 10.0.0.2
SW1SwitchManaged
SSH · 10.0.0.3
SW2SwitchManaged
SSH · 10.0.0.4

Reference configuration (Cisco IOS)

inventory.ini

[red]
r1 ansible_host=10.0.0.1
r2 ansible_host=10.0.0.2
sw1 ansible_host=10.0.0.3
sw2 ansible_host=10.0.0.4
[red:vars]
ansible_connection=network_cli
ansible_network_os=ios
ansible_user=admin
ansible_password=Cl4ve-Segura!

playbook.yml

- name: Configurar banner en todos los equipos
  hosts: red
  gather_facts: false
  tasks:
    - name: Banner MOTD
      cisco.ios.ios_banner:
        banner: motd
        text: "Acceso solo a personal autorizado"
        state: present
    - name: Guardar configuración
      cisco.ios.ios_config:
        save_when: modified

Verification commands

CCNA exam tips

Ansible: agentless, push, YAML, SSH/NETCONF. Puppet and Chef: agent-based, pull, own language (Ruby).

Terraform is declarative and used mostly for infrastructure as code in the cloud.

How to use this template

Press “Edit this template”: the editor opens with the topology loaded and ready to change (undo with Ctrl+Z). You can also copy the JSON and paste it into the editor with File ▸ Import JSON…. Then add devices, change IPs and export to PDF, PNG or SVG.

To practice, rebuild the topology in Cisco Packet Tracer, GNS3 or Cisco Modeling Labs and paste the reference configuration on each device. Addresses and names are examples: change them to create your own variants.

JSON template for the editor

This is the full diagram in JSON format. Paste it into the editor (File ▸ Import JSON…) or press the edit button to load it automatically.

Edit this template

Frequently asked questions

What is the difference between Ansible and Puppet?

Ansible needs no agents and pushes configuration over SSH; Puppet installs an agent that polls the master server.

What is a playbook?

A YAML file describing the tasks to run on the inventory devices.

CCNA and Cisco are registered trademarks of Cisco Systems, Inc. This site is independent, not affiliated with Cisco and does not provide official exam material: the templates are study examples.

More related pages