How does Ansible manage network devices that cannot run Python?
AdvancedConceptFundamentals and Architecture
Answer
Network modules run on the control node, not the device. The control node opens a session with a network connection plugin (ansible.netcommon.network_cli over SSH, netconf, or httpapi), sends CLI commands or API calls, and parses the output.
[routers:vars]
ansible_connection=ansible.netcommon.network_cli
ansible_network_os=cisco.ios.ios
ansible_user=admin
This is why ansible_network_os is mandatory and why network playbooks use platform collections like cisco.ios, arista.eos or junipernetworks.junos. Facts and idempotency depend on the resource modules (ios_vlans, ios_interfaces) rather than raw CLI.
More on Fundamentals and Architecture
What is Ansible and what problem does it solve?BeginnerWhat does "agentless" mean in Ansible?BeginnerWhat are the requirements for the control node?BeginnerWhat does a managed node need?BeginnerIs Ansible push-based or pull-based?BeginnerWalk through what happens when you run `ansible-playbook site.yml`.Intermediate