Configuration as code — push, pull and plan
Each of the major configuration tools has a different philosophy: agentless vs agented, push vs pull, declarative vs imperative. You should be able to recognize each.
What you'll learn
- Identify each tool's transport model and language.
- Recognize a small Ansible playbook.
Comparison
Two questions sort every configuration tool. Push or pull: does a control node reach out to the devices, or does each device fetch its own configuration? Agent or agentless: must software run on every managed device, or is SSH (or an API) enough? Most network devices cannot run third-party agents, which is why agentless push dominates network automation.
| Tool | Model | Transport | Language |
|---|---|---|---|
| Ansible | Push | SSH (agentless) | YAML |
| Puppet | Pull | Agent + master | Puppet DSL (Ruby-like) |
| Chef | Pull | Agent + chef-server | Ruby |
| SaltStack | Push or pull | ZeroMQ + minions | YAML |
| Terraform | Push | Provider APIs (agentless) | HCL |
Ansible playbook example
Read it from the top. The three dashes start the YAML document. The play targets the routers group from the inventory and turns off fact gathering. Its two connection variables matter: ansible_connection selects network_cli, which drives the device's CLI over SSH, and ansible_network_os tells network_cli which CLI dialect to expect — without it, network_cli fails before the first task. Each task then calls the cli_config module with a line of configuration.
---
- name: Baseline the routers
hosts: routers
gather_facts: false
vars:
ansible_connection: ansible.netcommon.network_cli
ansible_network_os: netforge.nfcli.nfcli
tasks:
- name: Set hostname on each router
ansible.netcommon.cli_config:
config: "hostname {{ inventory_hostname }}"
- name: Configure NTP
ansible.netcommon.cli_config:
config: ntp server 0.pool.ntp.org9 more sections in this chapter, plus a 4-question quiz.
Modules 2–8 are part of the Course & Lab Pass and All-Access Max — start with a free account
You can see the title, summary, learning objectives and the opening sections. The rest of this chapter, like all of modules 2–8, comes with the Course & Lab Pass and All-Access Max. A free account opens Module 1: How Networks Work end-to-end and saves your labs — start there, no card required.
- Read every chapter in Module 1 — How Networks Work
- Save labs of up to 5 devices
- Save up to 3 topologies
- See the full course syllabus + chapter titles
Free account · no card required · compare plans any time