From 68a3e8163e03e70a341fc5da69ead40820cb5b4d Mon Sep 17 00:00:00 2001 From: Niku Toivola Date: Thu, 16 Jan 2014 15:14:40 +0200 Subject: [PATCH] allow ansible_ssh_private_key_file to be templated (thanks to benno) --- lib/ansible/runner/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index 189bcb3b927..d430c90ccda 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -708,6 +708,8 @@ class Runner(object): actual_pass = inject.get('ansible_ssh_pass', self.remote_pass) actual_transport = inject.get('ansible_connection', self.transport) actual_private_key_file = inject.get('ansible_ssh_private_key_file', self.private_key_file) + # allow ansible_ssh_private_key_file to be templated + actual_private_key_file = template.template(self.basedir, actual_private_key_file, inject, fail_on_undefined=True) self.sudo_pass = inject.get('ansible_sudo_pass', self.sudo_pass) self.su = inject.get('ansible_su', self.su) self.su_pass = inject.get('ansible_su_pass', self.su_pass)