-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
643 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,56 +32,35 @@ | |
import os.path | ||
import sys | ||
|
||
from ansible.plugins.connection.ssh import ( | ||
Connection as _ansible_ssh_Connection, | ||
DOCUMENTATION as _ansible_ssh_DOCUMENTATION, | ||
) | ||
|
||
DOCUMENTATION = """ | ||
name: mitogen_ssh | ||
author: David Wilson <[email protected]> | ||
connection: mitogen_ssh | ||
short_description: Connect over SSH via Mitogen | ||
description: | ||
- This connects using an OpenSSH client controlled by the Mitogen for | ||
Ansible extension. It accepts every option the vanilla ssh plugin | ||
accepts. | ||
version_added: "2.5" | ||
options: | ||
ssh_args: | ||
type: str | ||
vars: | ||
- name: ssh_args | ||
- name: ansible_ssh_args | ||
- name: ansible_mitogen_ssh_args | ||
ssh_common_args: | ||
type: str | ||
vars: | ||
- name: ssh_args | ||
- name: ansible_ssh_common_args | ||
- name: ansible_mitogen_ssh_common_args | ||
ssh_extra_args: | ||
type: str | ||
vars: | ||
- name: ssh_args | ||
- name: ansible_ssh_extra_args | ||
- name: ansible_mitogen_ssh_extra_args | ||
""" | ||
""" + _ansible_ssh_DOCUMENTATION.partition('options:\n')[2] | ||
|
||
try: | ||
import ansible_mitogen | ||
except ImportError: | ||
base_dir = os.path.dirname(__file__) | ||
sys.path.insert(0, os.path.abspath(os.path.join(base_dir, '../../..'))) | ||
del base_dir | ||
sys.path.insert(0, os.path.abspath(os.path.join(__file__, '../../../..'))) | ||
|
||
import ansible_mitogen.connection | ||
import ansible_mitogen.loaders | ||
|
||
|
||
class Connection(ansible_mitogen.connection.Connection): | ||
transport = 'ssh' | ||
vanilla_class = ansible_mitogen.loaders.connection_loader__get( | ||
'ssh', | ||
class_only=True, | ||
) | ||
|
||
@staticmethod | ||
def _create_control_path(*args, **kwargs): | ||
"""Forward _create_control_path() to the implementation in ssh.py.""" | ||
# https://github.com/dw/mitogen/issues/342 | ||
return Connection.vanilla_class._create_control_path(*args, **kwargs) | ||
return _ansible_ssh_Connection._create_control_path(*args, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.