I have a console server, console1, and I can use that to ssh into any device connected to the console server using this command: ssh console1 -p 300X
. So for example, if I want to connect to my Cisco router I would use ssh console1 -p 3003
. Here are a few of the host configs I have tried for the router:
[router]
rtr1 ansible_user=user ansible_password=pass[router:vars]
ansible=console1
ansible_port=3003
ansible_network_os=ios
ansible_connection=network_cli
ansible_become=true
ansible_become_method=enable
ansible_become_password=pass##############################OR#############################
[router]
rtr1 ansible_user=user ansible_password=pass[router:vars]
ansible_network_os=ios
ansible_connection=network_cli
ansible_become=true
ansible_become_method=enable
ansible_become_password=pass
ansible_ssh_common_args=‘-p 3003 -J console1’
What am I doing wrong with this config? I know the playbook works because I am able to successfully run and change things on the router when the interface on the Cisco router is setup correctly. However, I think this means Ansible is using console1 to ssh into the Cisco router instead of using the console server to connect to the Cisco router. I need it to be able to configure a Cisco router with default settings and the only connection interface being the console server. Any help would be appreciated!