New in version 2.4.
| parameter | required | default | choices | comments |
|---|---|---|---|---|
| command |
yes |
List of commands to be executed in the telnet session.
|
||
| host |
no | remote_addr |
The host/target on which to execute the command
|
|
| password |
no |
The password for login
|
||
| pause |
no | 1 |
Seconds to pause between each command issued
|
|
| port |
no | 23 |
Remote port to use
|
|
| prompts |
no | [u'$'] |
List of prompts expected before sending next command
|
|
| timeout |
no | 120 |
timeout for remote operations
|
|
| user |
no | remote_user |
The user for login
|
- name: send configuration commands to IOS telnet: user: cisco password: cisco login_prompt: "Username: " prompts: - "[>|#]" command: - terminal length 0 - configure terminal - hostname ios01 - name: run show commands telnet: user: cisco password: cisco login_prompt: "Username: " prompts: - "[>|#]" command: - terminal length 0 - show version
Common return values are documented here Return Values, the following are the fields unique to this module:
| name | description | returned | type | sample |
|---|---|---|---|---|
| output |
output of each command is an element in this list
|
always | list | ['success', 'success', '', 'warning .. something'] |
Note
environment keyword does not work with this taskThis module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.