Have you tried setting remote_user? see
https://docs.ansible.com/ansible/latest/plugins/connection/network_cli.html for
details
Also does the Cisco IOS device actually allow password authentication with
SSH? You can check with something like:
enable
conf term
ip ssh server authenticate user pas
1. Yes. remote_user is already set on ansible.cfg file:
# SSH timeout
#timeout = 10
# default user to use for playbooks if user is not specified
# (/usr/bin/ansible will use current user as default)
remote_user = ansible
# logging is off by default unless this path is defined
# if so defined, con
Hi!
To simplify stuff I am troubleshooting this problem with the command below:
ansible -m ios_command -e commands='sh ip int br' -i
/etc/ansible/inventory/ R-TEST-SNIF -e 'ansible_connection=network_cli' -e
'ansible_network_os=ios' -u ansible -k
It will make it easier to troubleshoot this probl
I’ve tried a few connections:
It seems that ansible_user is not honoured with the network_cli plugin so make
sure you’re not using that still:
$ ansible cisco -m ios_command -a "commands='sh ip int br'" -e
'ansible_connection=network_cli' -e 'ansible_network_os=ios' -e
'ansible_user=ansible' -
[ansible@Netauto-Dev new_vlan]$ ansible -m ios_command -e commands='sh ip
int br' -i /etc/ansible/inventory/ R-TEST-SNIF -e
'ansible_connection=network_cli' -e 'ansible_network_os=ios' -e
'remote_user=ansible' -k
SSH password:
[WARNING]: Found variable using reserved name: remote_user
R-TEST-S
I only removed the SSH key to remove pub key authentication from the router. As
it’s the first authentication protocol used, the ansible command was ignoring
the passed in username/password.
It was for testing only. Your router config does pub key -> kbd interactive ->
password authentication ou
Yea you are right. I am hitting this bug and I can't see myself pulling
this off.
I'll just go with the pubkey method although I wanted to avoid it because I
have lots of network devices. But no choice here because Ansible is not
going to work without SSH keys on these IOS versions.
FYI,
This