liveBook · Manning

Infrastructure as code

As explained in Acing the CCNA Exam: Volume 2 Advanced Networking and Security

Infrastructure as code is the practice of defining and managing infrastructure through machine-readable configuration rather than manual operations.

Infrastructure as code (IaC) defines and manages servers, network devices, and other infrastructure through machine-readable configuration instead of manual, one-by-one operations. It addresses configuration drift, human error, inconsistent standards, and the poor scalability of manual administration. Configuration files describe the desired infrastructure state and the settings needed to achieve it, enabling version control, repeatable deployments, and automated provisioning, management, and decommissioning. section 25.0 section 25.2

Classify IaC and configuration-management tools along three operational dimensions:

  • Agentless tools require no software agent on managed devices; agent-based tools require an installed agent. section 25.2
  • Procedural tools specify ordered steps, whereas declarative tools specify the desired end state and determine how to reach it. section 25.2
  • Push models send configuration from a management server; pull models have managed devices request configuration from the server. section 25.2
  • Ansible, Terraform, Puppet, and Chef exemplify IaC, but they differ in language, architecture, workflow, and primary use. section 25.2 section 25.3

Network configuration as code

A shared configuration can combine fixed settings with variables: hostname {{hostname}}, NTP and logging servers, OSPF settings, and interface addresses such as {{g0/0addr}} and {{g0/0mask}}. A separate YAML variable file supplies values such as hostname R1, address 192.168.12.1, and mask 255.255.255.252. The resulting configuration can be applied consistently to multiple devices. section 25.2

Figure 25.3 Configuring devices with a configuration management tool. Configurations are centrally managed from a shared folder. A server running a configuration management tool applies configuration changes to devices.

Shows the central-management pattern: configuration files reside in a shared location, and a configuration-management server applies changes to managed devices. section 25.2

Distinguish the principal tools by their implementation model:

  • Ansible uses YAML, SSH or NETCONF, an agentless push architecture, and a mainly procedural approach; its files include inventories, templates, variables, and playbooks. section 25.2 section 25.3
  • Terraform uses HCL, an agentless push architecture, and a declarative approach; it primarily provisions new infrastructure rather than configuring existing devices. section 25.2.2 section 25.3
  • Terraform’s Write-Plan-Apply workflow defines resources, previews changes, and executes the approved provisioning plan. section 25.2.2
  • Puppet uses Ruby, Puppet DSL, agents, and a pull model; Chef shares Ruby, agent-based, and pull-oriented characteristics. section 25.2.3 section 25.2
Figure 25.6 Provisioning resources with Terraform. Configuration files are processed byTerraform Core to interact with various providers (i.e., public cloud providers) and manage infrastructure resources while maintaining state information in the state file.
A diagram of a software process Description automatically generated

Maps Terraform’s declarative path from configuration files through Terraform Core and providers to provisioned resources and maintained state. section 25.2.2

How Acing the CCNA Exam: Volume 2 Advanced Networking and Security covers it

How deep it goes
Defines IaC, compares tool models, and demonstrates configuration artifacts; stops short of detailed implementation procedures.
Examples
Uses network configuration templates, YAML variables, Ansible files, Terraform HCL, and Puppet DSL declarations.
What it assumes
Assumes familiarity with infrastructure configuration and introduces IaC terminology, tool distinctions, file types, and workflows.
What you can do after
Evaluate IaC tools by architecture, workflow, language, and primary role, then recognize their infrastructure-management use cases.
How it connects
Connects infrastructure as code with configuration management, provisioning, declarative programming, version control, Terraform, Ansible, Puppet, and Chef.

Also explained in

Compare how 14 books explain infrastructure as code →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the CCNA Exam: Volume 2 Advanced Networking and Security. The section links point to the parts of the book it draws on.