mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
telnet action plugin (#27983)
* draft telnet action plugin docs in module * updated per feedback * fixed imports * pep8 fixes * added meta import even though its useless
This commit is contained in:
parent
039383d90f
commit
40d29936a4
2 changed files with 156 additions and 0 deletions
75
lib/ansible/modules/commands/telnet.py
Normal file
75
lib/ansible/modules/commands/telnet.py
Normal file
|
@ -0,0 +1,75 @@
|
|||
# this is a virtual module that is entirely implemented server side
|
||||
# Copyright: Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
ANSIBLE_METADATA = {'metadata_version': '1.0',
|
||||
'status': ['preview'],
|
||||
'supported_by': 'community'}
|
||||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: telnet
|
||||
short_description: Executes a low-down and dirty telnet command
|
||||
version_added: 2.4
|
||||
description:
|
||||
- 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.
|
||||
options:
|
||||
commands:
|
||||
description:
|
||||
- List of commands to be executed in the telnet session.
|
||||
required: True
|
||||
host:
|
||||
description:
|
||||
- The host/target on which to execute the command
|
||||
required: False
|
||||
default: remote_addr
|
||||
user:
|
||||
description:
|
||||
- The user for login
|
||||
required: False
|
||||
default: remote_user
|
||||
password:
|
||||
description:
|
||||
- The password for login
|
||||
port:
|
||||
description:
|
||||
- Remote port to use
|
||||
default: 23
|
||||
timeout:
|
||||
description:
|
||||
- timeout for remote operations
|
||||
default: 120
|
||||
command:
|
||||
description:
|
||||
- Command to execute in telnet session
|
||||
required: True
|
||||
pause:
|
||||
description:
|
||||
- Seconds to pause between each command issued
|
||||
required: False
|
||||
default: 1
|
||||
notes:
|
||||
- The C(environment) keyword does not work with this task
|
||||
author:
|
||||
- Ansible Core Team
|
||||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
- name: Force ssh on IOS
|
||||
telnet:
|
||||
command: transport input ssh
|
||||
user: cisco
|
||||
password: cisco
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
output:
|
||||
description: output of each command is an element in this list
|
||||
type: list
|
||||
returned: always
|
||||
sample: [ 'success', 'success', '', 'warning .. something' ]
|
||||
'''
|
Loading…
Add table
Add a link
Reference in a new issue