Open felixblang opened 2 years ago
I jumped the gun and created a pull request for a workaround I had just intended to propose here. I have been using this implementation adjustment in my own environment to circumvent this problem.
My fix for this issue is introducing an optional network_cli option coax_prompt
that will send a newline after making a successful connection. The referenced pull request above has this behavior implemented if anyone wants a short term solution.
SUMMARY
I am trying to connect to a network switch through a console server. For this i'm establishing a ssh connection to the console server and going through prompts to connect to the right serial port. once i connect to the serial port though the network_cli module seems to be still waiting for a prompt. Due to the nature of serial connetions there is no prompt and the connection times out without executing any tasks on the host.
ISSUE TYPE
COMPONENT NAME
network_cli
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Cisco IOS XE Software, Version 16.12.05b
STEPS TO REPRODUCE
use an opengear console server to foreward an ssh session to a serial port in the format
to connect to the switch on serial port 1 and execute any playbook using this connection.
EXPECTED RESULTS
ansible should execute tasks on the host
ACTUAL RESULTS
ansible times out waiting for a prompt from the connection. the tasks actually run if a prompt is generated by manually forcing a newline on the serial console while ansible is waiting to time out