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

* fix ssh cli defaults

  fixes #75221

(cherry picked from commit e5a2fe4c41)

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
pull/76390/head
Benoît Knecht 3 years ago committed by GitHub
parent 08404fc511
commit 2ce007fb9a
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.

@ -253,13 +253,13 @@ def add_connect_options(parser):
help="connection type to use (default=%s)" % C.DEFAULT_TRANSPORT) help="connection type to use (default=%s)" % C.DEFAULT_TRANSPORT)
connect_group.add_argument('-T', '--timeout', default=C.DEFAULT_TIMEOUT, type=int, dest='timeout', connect_group.add_argument('-T', '--timeout', default=C.DEFAULT_TIMEOUT, type=int, dest='timeout',
help="override the connection timeout in seconds (default=%s)" % C.DEFAULT_TIMEOUT) help="override the connection timeout in seconds (default=%s)" % C.DEFAULT_TIMEOUT)
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)

@ -83,6 +83,7 @@ DOCUMENTATION = '''
version_added: '2.7' version_added: '2.7'
vars: vars:
- name: ansible_ssh_common_args - name: ansible_ssh_common_args
default: ''
ssh_executable: ssh_executable:
default: ssh default: ssh
description: description:
@ -130,6 +131,7 @@ DOCUMENTATION = '''
- key: scp_extra_args - key: scp_extra_args
section: ssh_connection section: ssh_connection
version_added: '2.7' version_added: '2.7'
default: ''
sftp_extra_args: sftp_extra_args:
description: Extra exclusive to the ``sftp`` CLI description: Extra exclusive to the ``sftp`` CLI
vars: vars:
@ -141,6 +143,7 @@ DOCUMENTATION = '''
- key: sftp_extra_args - key: sftp_extra_args
section: ssh_connection section: ssh_connection
version_added: '2.7' version_added: '2.7'
default: ''
ssh_extra_args: ssh_extra_args:
description: Extra exclusive to the 'ssh' CLI description: Extra exclusive to the 'ssh' CLI
vars: vars:
@ -152,6 +155,7 @@ DOCUMENTATION = '''
- key: ssh_extra_args - key: ssh_extra_args
section: ssh_connection section: ssh_connection
version_added: '2.7' version_added: '2.7'
default: ''
retries: retries:
# constant: ANSIBLE_SSH_RETRIES # constant: ANSIBLE_SSH_RETRIES
description: Number of attempts to connect. description: Number of attempts to connect.

Loading…
Cancel
Save