diff --git a/lib/ansible/connection.py b/lib/ansible/connection.py index 01bf45bbc91..85a004864c3 100644 --- a/lib/ansible/connection.py +++ b/lib/ansible/connection.py @@ -99,7 +99,7 @@ class ParamikoConnection(object): if 'user' in credentials: user = credentials['user'] if 'identityfile' in credentials: - keypair = credentials['identityfile'] + keypair = os.path.expanduser(credentials['identityfile']) ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())