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) help="override the connection timeout in seconds (default=%s)" % C.DEFAULT_TIMEOUT)
# ssh only # 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)") 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)") 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)") 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)") help="specify extra arguments to pass to ssh only (e.g. -R)")
parser.add_argument_group(connect_group) parser.add_argument_group(connect_group)

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

Loading…
Cancel
Save