[stable-2.14] Add ssh_args and friends back, add var for proxy_command (#78826) (#78836)

* [stable-2.14] Add ssh_args and friends back, add var for proxy_command (#78826)

Fixes #78750
(cherry picked from commit 1b47def)

Co-authored-by: Matt Martz <matt@sivel.net>

* Remove non-backportable changes
pull/78841/head
Matt Martz 2 years ago committed by GitHub
parent 3b937123d2
commit c71fdadadb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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,45 @@ DOCUMENTATION = """
env: [{name: ANSIBLE_PARAMIKO_PROXY_COMMAND}]
ini:
- {key: proxy_command, section: paramiko_connection}
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'
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: ''
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: ''
pty:
default: True
description: 'SUDO usually requires a PTY, True to give a PTY and False to not give a PTY.'
@ -267,9 +306,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 +326,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:

Loading…
Cancel
Save