Automation and Artificial Intelligence · Topic 7 of 7
Agent and Agentless Orchestration Tools
Compare agent based and agentless tools such as Ansible, Puppet, Chef and Salt, with push and pull models, declarative design and idempotency.
- 5 min
- Agentless tools need no software on the device. Agent based tools do.
- Ansible is agentless, uses YAML playbooks, and pushes changes over SSH or APIs.
- Puppet and Chef are agent based and pull their configuration from a server.
What it is
Orchestration and configuration management tools apply the same settings to many devices, and they differ in whether software must be installed on each device.
An agent based tool needs a small program, the agent, running on every managed device.
An agentless tool needs nothing extra on the device. It connects using a method that the device already has, such as SSH or an API. This choice affects what the tool can manage, how it scales and how much work it adds.
How it works
The tools differ in the connection method, the direction of the work and the language.
Agentless tools
An agentless tool logs in to a device and does the work from the outside.
Ansible is the best known. It runs from a control node, and it connects to network devices over SSH, or with NETCONF or an API.
Instructions are written in YAML files called playbooks, and devices are listed in an inventory. Ansible uses a push model, so you run it and it pushes the change out.
---
- name: Configure NTP on switches
hosts: switches
gather_facts: false
tasks:
- name: Set the NTP server
cisco.ios.ios_config:
lines:
- ntp server 192.0.2.10
The playbook picks the group switches from the inventory. It runs one task that uses a module for IOS to make sure the line is present. Each module knows how to talk to one kind of device.
Terraform is another agentless tool, built for provisioning. You describe the resources that you want in a declarative language, and the tool uses provider plugins and APIs to create them. It is used a lot for cloud and for controllers.
Agent based tools
An agent based tool installs an agent on the managed system. The agent contacts a central server on a schedule, and asks for its configuration.
Puppet uses a server, called the Puppet master or Puppet Server depending on the release, and an agent on each node. The agent checks in with the server at a regular interval, which is every 30 minutes by default unless it is changed, and applies the settings that the server holds. Puppet code is written in its own declarative language, in files called manifests.
Chef also uses a server and a client on each node. Its instructions are called recipes, and they are grouped into cookbooks. They are written in Ruby.
SaltStack uses a master and agents called minions, and it can also run without agents over SSH. It uses YAML for its state files.
Puppet and Chef are pull based, because the agents ask for their configuration. Agent based tools suit servers where an agent can be installed. Many network devices do not run a general purpose agent, so these tools are used less on switches and routers, except on platforms that offer a place to run one.
Push and pull
| Model | Direction | Example |
|---|---|---|
| Push | The control node sends changes to devices | Ansible |
| Pull | Each device asks the server for its changes | Puppet, Chef |
A push tool acts when you run it. A pull tool keeps checking, and so it corrects drift without anyone starting a run. Drift is when a device moves away from the intended configuration.
Comparing the tools
| Tool | Agent | Model | Language |
|---|---|---|---|
| Ansible | No | Push | YAML playbooks |
| Terraform | No | Push, through providers | HCL, a declarative language |
| Puppet | Yes | Pull | Puppet language, manifests |
| Chef | Yes | Pull | Ruby, recipes and cookbooks |
| SaltStack | Agent, or agentless with SSH | Mostly push, can also run on a schedule | YAML states |
Declarative and idempotent
Most of these tools are declarative. You describe the end state you want, such as the NTP server being present, and the tool works out the steps. The opposite, an imperative or procedural style, lists the steps.
A good tool is idempotent. Running it again does not change a device that already matches the target.
If the NTP line is present, nothing happens. This makes it safe to run the same playbook many times.
Choosing between them
| Factor | Agentless | Agent based |
|---|---|---|
| Setup | Quick, nothing to install | Needs an agent on each device |
| Network devices | Works well, since SSH or API exists | Limited by what runs on the device |
| Drift correction | Only when run, unless scheduled | Continuous, since agents check in |
| Scale | Control node must reach every device | Agents spread the work |
| Security | Needs credentials on the control node | Needs agent certificates and an open port to the server |
For switches and routers, agentless tools are the usual choice, because the devices already offer SSH, NETCONF or REST APIs.
What to remember for the exam
Eight facts cover most questions on this topic.
- Agentless tools need no software on the device. Agent based tools do.
- Ansible is agentless, uses YAML playbooks, and pushes changes over SSH or APIs.
- Puppet and Chef are agent based and pull their configuration from a server.
- Puppet uses manifests, and Chef uses Ruby recipes and cookbooks.
- Terraform is declarative and agentless, and it uses providers.
- Push means the control node sends the change. Pull means the device asks for it.
- A declarative tool describes the end state.
- An idempotent run changes nothing on a device that already matches.
When a question says no software is installed on the managed switch, think agentless, and the usual example is Ansible.
Common mistakes
These four mistakes appear often.
Saying Ansible needs an agent. It connects over SSH or an API from a control node.
Mixing up push and pull. Ansible pushes, and Puppet and Chef agents pull.
Confusing declarative with imperative. Declarative states the goal, and imperative lists steps.
Assuming agentless means no credentials. The control node still needs access to each device.
An idempotent tool still changes a device that differs from the target, so test on a small group first.
Check yourself
Work through these three questions.
What is the main difference between agent based and agentless tools?
An agent based tool needs software installed on each device, and an agentless tool connects with SSH or an API and needs nothing extra.
Which model do Puppet and Chef use, push or pull?
Pull, because the agent on each node asks the server for its configuration.
What does idempotent mean?
Running the same job again changes nothing on a device that already matches the intended state.
Topic 7 of 7 in Automation and Artificial Intelligence
Test yourself on Automation and Artificial Intelligence
The full Cisco CCNP 350-401 ENCOR question bank has 854 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Cisco. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.