From b82249167ce40f7706ffaf2db91e87abf314234b Mon Sep 17 00:00:00 2001 From: celestialsahil <93261348+celestialsahil@users.noreply.github.com> Date: Mon, 22 Sep 2025 18:42:26 +0530 Subject: [PATCH] added scp_if_ssh --- plugins/connection/iap.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/plugins/connection/iap.py b/plugins/connection/iap.py index c4b1d7f0..1e22b4f2 100644 --- a/plugins/connection/iap.py +++ b/plugins/connection/iap.py @@ -14,6 +14,7 @@ from __future__ import annotations # 1. Changed default private_key_file default to ~/.ssh/google_compute_engine # 2. Make host_key_checking default to False # 3. Added known_hosts_file option pointing to ~/.ssh/google_compute_known_hosts +# 4. Added missing scp_if_ssh option to fix compatibility issues DOCUMENTATION = """ name: iap short_description: connect via SSH through Google Cloud's Identity Aware Proxy (IAP) @@ -257,6 +258,19 @@ DOCUMENTATION = """ - name: ansible_scp_extra_args cli: - name: scp_extra_args + scp_if_ssh: + description: + - Fallback to SCP (Secure Copy Protocol) when SFTP is not available. + - When enabled and SFTP fails, Ansible will try to use SCP for file transfers. + type: bool + default: smart + ini: + - section: ssh_connection + key: scp_if_ssh + env: + - name: ANSIBLE_SCP_IF_SSH + vars: + - name: ansible_scp_if_ssh sftp_extra_args: description: Extra exclusive to the C(sftp) CLI type: string @@ -772,4 +786,4 @@ class Connection(sshconn.Connection): # remove ssh config os.unlink(self.ssh_config) - self._connected = False + self._connected = False \ No newline at end of file