.. _ansible.netcommon.telnet_module: ************************ ansible.netcommon.telnet ************************ **Executes a low-down and dirty telnet command** Version added: 1.0.0 .. contents:: :local: :depth: 1 Synopsis -------- - Executes a low-down and dirty telnet command, not going through the module subsystem. - This is mostly to be used for enabling ssh on devices that only have telnet enabled by default. Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
command
list / elements=string / required
List of commands to be executed in the telnet session.

aliases: commands
host
string
Default:
"remote_addr"
The host/target on which to execute the command
login_prompt
string
Default:
"login: "
Login or username prompt to expect
password
string
The password for login
password_prompt
string
Default:
"Password: "
Login or username prompt to expect
pause
integer
Default:
1
Seconds to pause between each command issued
port
integer
Default:
23
Remote port to use
prompts
list / elements=string
Default:
["$"]
List of prompts expected before sending next command
send_newline
boolean
    Choices:
  • no ←
  • yes
Sends a newline character upon successful connection to start the terminal session.
timeout
integer
Default:
120
timeout for remote operations
user
string
Default:
"remote_user"
The user for login

Notes ----- .. note:: - The ``environment`` keyword does not work with this task Examples -------- .. code-block:: yaml - name: send configuration commands to IOS ansible.netcommon.telnet: user: cisco password: cisco login_prompt: 'Username: ' prompts: - '[>#]' command: - terminal length 0 - configure terminal - hostname ios01 - name: run show commands ansible.netcommon.telnet: user: cisco password: cisco login_prompt: 'Username: ' prompts: - '[>#]' command: - terminal length 0 - show version Return Values ------------- Common return values are documented `here `_, the following are the fields unique to this module: .. raw:: html
Key Returned Description
output
list
always
output of each command is an element in this list

Sample:
['success', 'success', '', 'warning .. something']


Status ------ Authors ~~~~~~~ - Ansible Core Team