From 6a97e49a06effe5d650fe31a1eae2d98fdddc58e Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Thu, 4 Jun 2015 08:15:25 -0500 Subject: [PATCH] Re-introduce ssh connection private key support --- lib/ansible/plugins/connections/ssh.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/ansible/plugins/connections/ssh.py b/lib/ansible/plugins/connections/ssh.py index b3ada343c0..1d79cb4e90 100644 --- a/lib/ansible/plugins/connections/ssh.py +++ b/lib/ansible/plugins/connections/ssh.py @@ -95,11 +95,8 @@ class Connection(ConnectionBase): if self._connection_info.port is not None: self._common_args += ("-o", "Port={0}".format(self._connection_info.port)) - # FIXME: need to get this from connection info - #if self.private_key_file is not None: - # self._common_args += ("-o", "IdentityFile=\"{0}\"".format(os.path.expanduser(self.private_key_file))) - #elif self.runner.private_key_file is not None: - # self._common_args += ("-o", "IdentityFile=\"{0}\"".format(os.path.expanduser(self.runner.private_key_file))) + if self._connection_info.private_key_file is not None: + self._common_args += ("-o", "IdentityFile=\"{0}\"".format(os.path.expanduser(self._connection_info.private_key_file))) if self._connection_info.password: self._common_args += ("-o", "GSSAPIAuthentication=no", "-o", "PubkeyAuthentication=no")