ESTABLISH LOCAL CONNECTION
is not a -vvv message I would expect, the local connection plugin just execs commands on localhost. Note the /bin/sh shell, not something found on IOS. For network_cli, I would expect LOCAL
to instead be PARAMIKO
or LIBSSH
. (Years ago network devices used local connection plugin plus module parameters, but this is long obsolete by actual connection plugins.)
Network troubleshooting guide suggests it could be just ESTABLISH CONNECTION
. But that could be outdated; modern connection plugins by convention include their name.
So your connection variables are consistent with how to configure connections to IOS, but they may not be applying correctly. Which you put in group_vars, which is a fine choice. However, I think defining hosts R1
and SW1
twice is causing problems.
Keeping your ini format inventory, delete the hosts outside the group but keep the host variables:
[netgrp]
R1 ansible_host=192.168.20.1
SW1 ansible_host=192.168.10.2
Vars can be defined almost anywhere. Try defining these in other places, to see what works, and what feels natural. For example, there is syntax for defining group level vars in inventory which could replace your use of group_vars for connection details.
[netgrp:vars]
ansible_connection=network_cli
ansible_network_os=ios
ansible_user=abdo
ansible_become_method=enable