Quiz Entry - updated: 2026.10.22
How does Ansible manage network devices like routers and switches when they can't run Python?
The network modules run on the control node, not on the device, and talk to the device over CLI over SSH, XML over SSH (NETCONF), or an API over HTTP(S).
* Ansible is installed only on the control node; for network devices the module runs there instead of on the device. *
Playbooks for network devices use the same techniques as playbooks for servers, but execution is different:
- Most network devices cannot run Python, so Ansible can't push a module to them.
- Instead the module runs locally on the control node and uses a special connection method to the device:
- CLI over SSH, sending commands the way an admin would type them (
network_cli), - XML over SSH, i.e. NETCONF,
- API over HTTP(S), e.g. RESTCONF or a vendor REST API.
- CLI over SSH, sending commands the way an admin would type them (
Ansible ships many modules for this, including support for Cisco IOS, IOS XR and NX-OS, Juniper Junos, Arista EOS and VyOS.
Go deeper:
How network automation is different (official docs) — modules run on the control node, with the
network_cli,netconfandhttpapiconnection types.Network platform options (official docs) — table of supported platforms (IOS, NX-OS, Junos, EOS, VyOS) and which connection each supports.