From ce0b5d16b36a652c2bd6d0979c92726a13acb586 Mon Sep 17 00:00:00 2001 From: Thomas Omans Date: Tue, 21 Jan 2014 12:37:04 -0800 Subject: [PATCH 1/2] Allow templates in ansible_sudo_pass inventory var Template ansible_sudo_pass the same way we template ansible_ssh_pass. --- 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 b5138bf1500..27c741267ce 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -688,6 +688,8 @@ class Runner(object): # user/pass may still contain variables at this stage actual_user = template.template(self.basedir, actual_user, inject) actual_pass = template.template(self.basedir, actual_pass, inject) + self.sudo_pass = template.template(self.basedir, self.sudo_pass, inject) + # make actual_user available as __magic__ ansible_ssh_user variable inject['ansible_ssh_user'] = actual_user From 9343db69b41487c3ca783caa827926ebf3a02d6e Mon Sep 17 00:00:00 2001 From: Thomas Omans Date: Tue, 21 Jan 2014 12:44:36 -0800 Subject: [PATCH 2/2] Fixing whitespace --- lib/ansible/runner/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index 27c741267ce..99fe1d17e0c 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -689,7 +689,6 @@ class Runner(object): actual_user = template.template(self.basedir, actual_user, inject) actual_pass = template.template(self.basedir, actual_pass, inject) self.sudo_pass = template.template(self.basedir, self.sudo_pass, inject) - # make actual_user available as __magic__ ansible_ssh_user variable inject['ansible_ssh_user'] = actual_user