Connecting to network devices
As we have seen, there are some peculiarities in Ansible networking, so specific configurations are required.
To manage network devices with Ansible, you need to have at least one to test on. Let’s assume we have a Cisco IOS system available to us. It is accepted that not everyone will have such a device to test on, so the following is offered as a hypothetical example only.
Going by the https://docs.ansible.com/ansible/latest/network/user_guide/platform_index.html page, we can see that the correct ansible_network_os
for this device is cisco.ios.ios
and that we can connect to it using both network_cli
and local
. Since local
is deprecated, we are going to use network_cli
. Follow these steps to configure Ansible so that you can manage IOS devices:
- First, let’s create the inventory file with our devices in the
routers
group:[routers] n1.example.org n2.example.org [cumulusvx] vx01.example.org
- To know which connection parameters...