3f22f79e73
* Ensure -k is set to delegated hosts without a pass * Fix up some broken tests * Update task_executor.py one possible fix, the other is updating winrm to normalize on 'password' like the other connection plugins * Add alias for winrm and fix incorrect assumption * Make sure aliases are used for keyword options * Conditionally run test if sshpass is present, fix sanity Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
45 lines
1.2 KiB
Python
45 lines
1.2 KiB
Python
from __future__ import (absolute_import, division, print_function)
|
|
__metaclass__ = type
|
|
|
|
DOCUMENTATION = """
|
|
author: Ansible Core Team
|
|
connection: delegation_connection
|
|
short_description: Test connection for delegated host check
|
|
description:
|
|
- Some further description that you don't care about.
|
|
options:
|
|
remote_password:
|
|
description: The remote password
|
|
type: str
|
|
vars:
|
|
- name: ansible_password
|
|
# Tests that an aliased key gets the -k option which hardcodes the value to password
|
|
aliases:
|
|
- password
|
|
"""
|
|
|
|
from ansible.plugins.connection import ConnectionBase
|
|
|
|
|
|
class Connection(ConnectionBase):
|
|
|
|
transport = 'delegation_connection'
|
|
has_pipelining = True
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
super(Connection, self).__init__(*args, **kwargs)
|
|
|
|
def _connect(self):
|
|
super(Connection, self)._connect()
|
|
|
|
def exec_command(self, cmd, in_data=None, sudoable=True):
|
|
super(Connection, self).exec_command(cmd, in_data, sudoable)
|
|
|
|
def put_file(self, in_path, out_path):
|
|
super(Connection, self).put_file(in_path, out_path)
|
|
|
|
def fetch_file(self, in_path, out_path):
|
|
super(Connection, self).fetch_file(in_path, out_path)
|
|
|
|
def close(self):
|
|
super(Connection, self).close()
|