Note
This plugin is part of the ansible.netcommon collection.
To install it use: ansible-galaxy collection install ansible.netcommon
.
To use it in a playbook, specify: ansible.netcommon.telnet
.
New in version 1.0.0: of ansible.netcommon
Note
This module has a corresponding action plugin.
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 |
| 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 |
Note
environment
keyword does not work with this task- 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
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
output list / elements=string | always | output of each command is an element in this list Sample: ['success', 'success', '', 'warning .. something'] |
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/ansible/netcommon/telnet_module.html