6.5 Configuration Management Tools

Key Takeaways

  • Ansible is agentless (uses SSH), uses YAML playbooks, and is ideal for network device configuration.
  • Terraform is for infrastructure provisioning — it creates and manages cloud resources and network infrastructure declaratively.
  • Ansible is procedural ('do these steps'); Terraform is declarative ('make the state look like this').
  • Both tools support idempotency — running them multiple times produces the same result.
  • Puppet and Chef are agent-based alternatives (less common for networking than Ansible).
Last updated: March 2026

Configuration Management Tools

Configuration management tools automate the deployment and maintenance of consistent configurations across network devices. The CCNA v1.1 specifically tests Ansible and Terraform.

Ansible

Ansible is an open-source automation tool that is particularly popular for network device configuration.

Key Characteristics

FeatureDetail
AgentlessNo software needs to be installed on managed devices — uses SSH
LanguageYAML (for playbooks) and Python (engine)
Push-basedController pushes configurations to devices
IdempotentRunning the same playbook twice produces the same result
DeveloperRed Hat (IBM)
Primary useConfiguration management, application deployment

Ansible Components

ComponentPurpose
InventoryList of managed devices (hosts, groups, IP addresses)
PlaybookYAML file defining the tasks to perform
ModulePre-built function for a specific task (e.g., ios_config for Cisco IOS)
TaskA single action within a playbook
RoleReusable collection of tasks, templates, and variables

Example Ansible Playbook (Network)

---
- name: Configure VLANs on switches
  hosts: access_switches
  gather_facts: no
  tasks:
    - name: Create VLAN 10
      cisco.ios.ios_vlans:
        config:
          - vlan_id: 10
            name: SALES
            state: active
        state: merged

    - name: Configure access port
      cisco.ios.ios_config:
        lines:
          - switchport mode access
          - switchport access vlan 10
        parents: interface GigabitEthernet0/1

Terraform

Terraform is an infrastructure-as-code tool for provisioning and managing infrastructure resources.

Key Characteristics

FeatureDetail
DeclarativeYou define the desired state; Terraform figures out how to get there
Provider-basedPlugins for cloud (AWS, Azure, GCP) and network (Cisco, Juniper)
State fileTracks the current state of managed resources
Plan before applyShows what will change before making changes
DeveloperHashiCorp
Primary useInfrastructure provisioning (cloud resources, VMs, networks)

Terraform Workflow

  1. Write — Define infrastructure in .tf files (HCL language)
  2. Plan — Preview what changes will be made (terraform plan)
  3. Apply — Execute the changes (terraform apply)
  4. Destroy — Remove all managed resources (terraform destroy)

Example Terraform Configuration

resource "aws_vpc" "main" {
  cidr_block = "10.0.0.0/16"

  tags = {
    Name = "Production-VPC"
  }
}

resource "aws_subnet" "web" {
  vpc_id     = aws_vpc.main.id
  cidr_block = "10.0.1.0/24"

  tags = {
    Name = "Web-Subnet"
  }
}

Ansible vs. Terraform

FeatureAnsibleTerraform
ApproachProcedural (step-by-step tasks)Declarative (desired state)
Primary useConfiguration managementInfrastructure provisioning
AgentAgentless (SSH)Agentless (API calls)
LanguageYAMLHCL (HashiCorp Configuration Language)
State trackingNo state fileYes (terraform.tfstate)
Network supportExcellent (many modules for Cisco, Arista, Juniper)Growing (providers for cloud networking)
Best for networkingDay-2 operations (configuring existing devices)Day-0 provisioning (creating infrastructure)

When to Use Each

ScenarioTool
Configure VLANs on 100 switchesAnsible
Deploy OSPF across the networkAnsible
Provision a new VPC in AWS with subnets and security groupsTerraform
Create a new virtual network in AzureTerraform
Push ACL updates to all firewallsAnsible
Stand up a complete cloud infrastructure from scratchTerraform

Other Configuration Management Tools

ToolAgentLanguageModel
PuppetAgent-based (Ruby agent on managed nodes)Ruby / Puppet DSLDeclarative, pull-based
ChefAgent-based (Ruby agent on managed nodes)RubyProcedural, pull-based
SaltStackAgent-based or agentlessYAML/PythonDeclarative or procedural

On the Exam: Know that Ansible is agentless (uses SSH), uses YAML playbooks, and is ideal for network device configuration. Terraform is declarative, uses state files, and is primarily for infrastructure provisioning. Both support idempotency.

Test Your Knowledge

Which configuration management tool is agentless and uses SSH to connect to network devices?

A
B
C
D
Test Your Knowledge

What is the primary difference between Ansible and Terraform?

A
B
C
D