Add ssh_args and friends back, add var for proxy_command (#78826)
Fixes #78750
This commit is contained in:
3
changelogs/fragments/78750-paramiko-ssh-args-compat.yml
Normal file
3
changelogs/fragments/78750-paramiko-ssh-args-compat.yml
Normal file
@ -0,0 +1,3 @@
|
||||
bugfixes:
|
||||
- paramiko - Add back support for ``ssh_args``, ``ssh_common_args``, and ``ssh_extra_args`` for parsing the ``ProxyCommand``
|
||||
(https://github.com/ansible/ansible/issues/78750)
|
||||
@ -79,6 +79,60 @@ DOCUMENTATION = """
|
||||
env: [{name: ANSIBLE_PARAMIKO_PROXY_COMMAND}]
|
||||
ini:
|
||||
- {key: proxy_command, section: paramiko_connection}
|
||||
vars:
|
||||
- name: ansible_paramiko_proxy_command
|
||||
version_added: '2.15'
|
||||
ssh_args:
|
||||
description: Only used in parsing ProxyCommand for use in this plugin.
|
||||
default: ''
|
||||
ini:
|
||||
- section: 'ssh_connection'
|
||||
key: 'ssh_args'
|
||||
env:
|
||||
- name: ANSIBLE_SSH_ARGS
|
||||
vars:
|
||||
- name: ansible_ssh_args
|
||||
version_added: '2.7'
|
||||
deprecated:
|
||||
why: In favor of the "proxy_command" option.
|
||||
version: "2.18"
|
||||
alternatives: proxy_command
|
||||
ssh_common_args:
|
||||
description: Only used in parsing ProxyCommand for use in this plugin.
|
||||
ini:
|
||||
- section: 'ssh_connection'
|
||||
key: 'ssh_common_args'
|
||||
version_added: '2.7'
|
||||
env:
|
||||
- name: ANSIBLE_SSH_COMMON_ARGS
|
||||
version_added: '2.7'
|
||||
vars:
|
||||
- name: ansible_ssh_common_args
|
||||
cli:
|
||||
- name: ssh_common_args
|
||||
default: ''
|
||||
deprecated:
|
||||
why: In favor of the "proxy_command" option.
|
||||
version: "2.18"
|
||||
alternatives: proxy_command
|
||||
ssh_extra_args:
|
||||
description: Only used in parsing ProxyCommand for use in this plugin.
|
||||
vars:
|
||||
- name: ansible_ssh_extra_args
|
||||
env:
|
||||
- name: ANSIBLE_SSH_EXTRA_ARGS
|
||||
version_added: '2.7'
|
||||
ini:
|
||||
- key: ssh_extra_args
|
||||
section: ssh_connection
|
||||
version_added: '2.7'
|
||||
cli:
|
||||
- name: ssh_extra_args
|
||||
default: ''
|
||||
deprecated:
|
||||
why: In favor of the "proxy_command" option.
|
||||
version: "2.18"
|
||||
alternatives: proxy_command
|
||||
pty:
|
||||
default: True
|
||||
description: 'SUDO usually requires a PTY, True to give a PTY and False to not give a PTY.'
|
||||
@ -267,9 +321,9 @@ class Connection(ConnectionBase):
|
||||
proxy_command = None
|
||||
# Parse ansible_ssh_common_args, specifically looking for ProxyCommand
|
||||
ssh_args = [
|
||||
getattr(self._play_context, 'ssh_extra_args', '') or '',
|
||||
getattr(self._play_context, 'ssh_common_args', '') or '',
|
||||
getattr(self._play_context, 'ssh_args', '') or '',
|
||||
self.get_option('ssh_extra_args'),
|
||||
self.get_option('ssh_common_args'),
|
||||
self.get_option('ssh_args', ''),
|
||||
]
|
||||
|
||||
args = self._split_ssh_args(' '.join(ssh_args))
|
||||
@ -287,7 +341,7 @@ class Connection(ConnectionBase):
|
||||
if proxy_command:
|
||||
break
|
||||
|
||||
proxy_command = proxy_command or self.get_option('proxy_command')
|
||||
proxy_command = self.get_option('proxy_command') or proxy_command
|
||||
|
||||
sock_kwarg = {}
|
||||
if proxy_command:
|
||||
|
||||
Reference in New Issue
Block a user