fix ssh cli defaults (#75245) (#75314)

* fix ssh cli defaults (#75245)

* fix ssh cli defaults

  fixes #75221

(cherry picked from commit e5a2fe4c41)

* github conflict?

* removed retries backrpot

  also removed tests since they rely on features that don't exist in this version
pull/75409/head
Brian Coca 3 years ago committed by GitHub
parent b866d6f708
commit d18ac7bdc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- cli defaults for ssh args set to None as '' was bypassing normal default.

@ -261,13 +261,13 @@ def add_connect_options(parser):
help="override the connection timeout in seconds (default=%s)" % C.DEFAULT_TIMEOUT)
# ssh only
connect_group.add_argument('--ssh-common-args', default='', dest='ssh_common_args',
connect_group.add_argument('--ssh-common-args', default=None, dest='ssh_common_args',
help="specify common arguments to pass to sftp/scp/ssh (e.g. ProxyCommand)")
connect_group.add_argument('--sftp-extra-args', default='', dest='sftp_extra_args',
connect_group.add_argument('--sftp-extra-args', default=None, dest='sftp_extra_args',
help="specify extra arguments to pass to sftp only (e.g. -f, -l)")
connect_group.add_argument('--scp-extra-args', default='', dest='scp_extra_args',
connect_group.add_argument('--scp-extra-args', default=None, dest='scp_extra_args',
help="specify extra arguments to pass to scp only (e.g. -l)")
connect_group.add_argument('--ssh-extra-args', default='', dest='ssh_extra_args',
connect_group.add_argument('--ssh-extra-args', default=None, dest='ssh_extra_args',
help="specify extra arguments to pass to ssh only (e.g. -R)")
parser.add_argument_group(connect_group)

@ -92,6 +92,7 @@ DOCUMENTATION = '''
- name: ansible_ssh_common_args
cli:
- name: ssh_common_args
default: ''
ssh_executable:
default: ssh
description:
@ -141,6 +142,7 @@ DOCUMENTATION = '''
version_added: '2.7'
cli:
- name: scp_extra_args
default: ''
sftp_extra_args:
description: Extra exclusive to the ``sftp`` CLI
vars:
@ -154,8 +156,10 @@ DOCUMENTATION = '''
version_added: '2.7'
cli:
- name: sftp_extra_args
default: ''
ssh_extra_args:
description: Extra exclusive to the 'ssh' CLI
default: ''
vars:
- name: ansible_ssh_extra_args
env:

Loading…
Cancel
Save