Open MarcHagen opened 1 year ago
@MarcHagen : If connecting manually via telent or with Python does sending "\r" work to clear this nag screen ?
Workaround, to be documented here :)
---
- hosts: switch
order: inventory
gather_facts: false
connection: local
tasks:
- name: Gather switch config and information
ansible.netcommon.telnet:
user: "\n<user>" <<<< newline first, then write username to console
password: <snip>
login_prompt: 'Press any key to continue'
password_prompt: 'Password: '
send_newline: true
timeout: 7
pause: 2
prompts:
- '[>|#]'
command:
- no page
- show config
- show lldp info local
- exit
SUMMARY
Using telnet to connect to a Procurve switch fails because the switch expects a "any key" to continue (nag banner) It seems the cli_command has a fix for this with
ansible_terminal_initial_prompt
.I don't belief this is a issue only with this type of switch, but can be any device with a (nag) banner that requires a input.
the
send_newline: true
doesn't seem to work, or the command is sended to quickly.ISSUE TYPE
COMPONENT NAME
ansible.netcommon.telnet
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Ubuntu 22.04.2 LTS
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
telnet session: