summaryrefslogtreecommitdiff
path: root/lib/ansible/plugins
diff options
context:
space:
mode:
authorBrian Coca <bcoca@users.noreply.github.com>2021-06-10 16:22:41 -0400
committerGitHub <noreply@github.com>2021-06-10 15:22:41 -0500
commit675df166c27bc82a4d9a7cba45e11aec0300ae2c (patch)
tree521c140f81eee3530c65ea04cad915b55f492c54 /lib/ansible/plugins
parent50e998e30362c02d89115e5933ee2b3af2d05edd (diff)
downloadansible-675df166c27bc82a4d9a7cba45e11aec0300ae2c.tar.gz
fix ssh_transfer_method/scp_if_ssh defaults (#74925)
* fix ssh_transfer_method/scp_if_ssh defaults fixes #74922 * clog
Diffstat (limited to 'lib/ansible/plugins')
-rw-r--r--lib/ansible/plugins/connection/ssh.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/ansible/plugins/connection/ssh.py b/lib/ansible/plugins/connection/ssh.py
index 992a71fdb9..e869753259 100644
--- a/lib/ansible/plugins/connection/ssh.py
+++ b/lib/ansible/plugins/connection/ssh.py
@@ -272,7 +272,6 @@ DOCUMENTATION = '''
- name: ansible_sftp_batch_mode
version_added: '2.7'
ssh_transfer_method:
- default: smart
description:
- "Preferred method to use when transferring files over ssh"
- Setting to 'smart' (default) will try them in order, until one succeeds or they all fail
@@ -281,6 +280,9 @@ DOCUMENTATION = '''
env: [{name: ANSIBLE_SSH_TRANSFER_METHOD}]
ini:
- {key: transfer_method, section: ssh_connection}
+ vars:
+ - name: ansible_ssh_transfer_method
+ version_added: '2.12'
scp_if_ssh:
default: smart
description:
@@ -1172,6 +1174,10 @@ class Connection(ConnectionBase):
# Use the transfer_method option if set, otherwise use scp_if_ssh
ssh_transfer_method = self.get_option('ssh_transfer_method')
+ scp_if_ssh = self.get_option('scp_if_ssh')
+ if ssh_transfer_method is None and scp_if_ssh == 'smart':
+ ssh_transfer_method = 'smart'
+
if ssh_transfer_method is not None:
if ssh_transfer_method == 'smart':
methods = smart_methods
@@ -1179,7 +1185,6 @@ class Connection(ConnectionBase):
methods = [ssh_transfer_method]
else:
# since this can be a non-bool now, we need to handle it correctly
- scp_if_ssh = self.get_option('scp_if_ssh')
if not isinstance(scp_if_ssh, bool):
scp_if_ssh = scp_if_ssh.lower()
if scp_if_ssh in BOOLEANS: