ansible.netcommon.telnet module – Executes a low-down and dirty telnet command
Note
This module is part of the ansible.netcommon collection (version 6.1.3).
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 |
---|---|
command aliases: commands list / elements=string / required | List of commands to be executed in the telnet session. |
crlf boolean | Sends a CRLF (Carrage Return) instead of just a LF (Line Feed). Choices:
|
host string | The host/target on which to execute the command Default: |
login_prompt string | Login or username prompt to expect Default: |
password string | The password for login |
password_prompt string | Login or username prompt to expect Default: |
pause integer | Seconds to pause between each command issued Default: |
port integer | Remote port to use Default: |
prompts list / elements=string | List of prompts expected before sending next command Default: |
send_newline boolean | Sends a newline character upon successful connection to start the terminal session. Choices:
|
timeout integer | timeout for remote operations Default: |
user string | 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 list / elements=string | output of each command is an element in this list Returned: always Sample: |
Collection links
© 2012–2018 Michael DeHaan
© 2018–2024 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/ansible/netcommon/telnet_module.html