ansible.netcommon.telnet module – Executes a low-down and dirty telnet command
Note
This module is part of the ansible.netcommon collection (version 7.1.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install ansible.netcommon
.
To use it in a playbook, specify: ansible.netcommon.telnet
.
New in ansible.netcommon 1.0.0
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.
Note
This module has a corresponding action plugin.
Parameters
Parameter |
Comments |
---|---|
List of commands to be executed in the telnet session. |
|
Sends a CRLF (Carrage Return) instead of just a LF (Line Feed). Choices:
|
|
The host/target on which to execute the command Default: |
|
Login or username prompt to expect Default: |
|
The password for login |
|
Login or username prompt to expect Default: |
|
Seconds to pause between each command issued Default: |
|
Remote port to use Default: |
|
List of prompts expected before sending next command Default: |
|
Sends a newline character upon successful connection to start the terminal session. Choices:
|
|
timeout for remote operations Default: |
|
The user for login Default: |
Notes
Note
The
environment
keyword does not work with this task
Examples
- 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:
Key |
Description |
---|---|
output of each command is an element in this list Returned: always Sample: |