From 956ce7acc2d83c3c99a3d302ee14ee88a8b30198 Mon Sep 17 00:00:00 2001 From: gardar Date: Mon, 17 May 2021 15:03:03 +0000 Subject: [PATCH 1/2] Fix ansible_ssh_common_args in molecule.yml Makes the option `ansible_ssh_common_args` in molecule.yml work as documented. --- src/molecule/driver/delegated.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/molecule/driver/delegated.py b/src/molecule/driver/delegated.py index 434db96d3..ebcf0eb46 100644 --- a/src/molecule/driver/delegated.py +++ b/src/molecule/driver/delegated.py @@ -171,7 +171,10 @@ def default_safe_files(self): @property def default_ssh_connection_options(self): if self.managed: - return self._get_ssh_connection_options() + ssh_connopts = self._get_ssh_connection_options() + if self.options.get("ansible_connection_options", {}).get("ansible_ssh_common_args", None): + ssh_connopts.append(self.options.get("ansible_connection_options").get("ansible_ssh_common_args")) + return ssh_connopts return [] def login_options(self, instance_name): From cf332bd4284f9b31ec41155d1f53bf7b621640ee Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Wed, 19 May 2021 15:29:01 +0100 Subject: [PATCH 2/2] Fixed formatting (black) --- src/molecule/driver/delegated.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/molecule/driver/delegated.py b/src/molecule/driver/delegated.py index ebcf0eb46..45ab23003 100644 --- a/src/molecule/driver/delegated.py +++ b/src/molecule/driver/delegated.py @@ -172,8 +172,14 @@ def default_safe_files(self): def default_ssh_connection_options(self): if self.managed: ssh_connopts = self._get_ssh_connection_options() - if self.options.get("ansible_connection_options", {}).get("ansible_ssh_common_args", None): - ssh_connopts.append(self.options.get("ansible_connection_options").get("ansible_ssh_common_args")) + if self.options.get("ansible_connection_options", {}).get( + "ansible_ssh_common_args", None + ): + ssh_connopts.append( + self.options.get("ansible_connection_options").get( + "ansible_ssh_common_args" + ) + ) return ssh_connopts return []