From df55b3998fc256c93b9c2f1e9edb3ab87b549d10 Mon Sep 17 00:00:00 2001 From: wokis Date: Fri, 26 Apr 2024 10:46:14 +0200 Subject: [PATCH] Always apply ssh_connection_options Always apply ssh_connection_options whether we use identity_file or password. --- src/molecule/driver/delegated.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/molecule/driver/delegated.py b/src/molecule/driver/delegated.py index 53bd627676..0aa75d1823 100644 --- a/src/molecule/driver/delegated.py +++ b/src/molecule/driver/delegated.py @@ -224,15 +224,16 @@ def ansible_connection_options(self, instance_name): if d.get("identity_file", None): conn_dict["ansible_private_key_file"] = d.get("identity_file") - conn_dict["ansible_ssh_common_args"] = " ".join( - self.ssh_connection_options, - ) if d.get("password", None): conn_dict["ansible_password"] = d.get("password") # Based on testinfra documentation, ansible password must be passed via ansible_ssh_pass # issue to fix this can be found https://github.com/pytest-dev/pytest-testinfra/issues/580 conn_dict["ansible_ssh_pass"] = d.get("password") + conn_dict["ansible_ssh_common_args"] = " ".join( + self.ssh_connection_options, + ) + return conn_dict except StopIteration: