From c6b8e1621dec9ca54f716a907437ba817f2beb75 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Fri, 20 Apr 2012 07:54:38 -0400 Subject: [PATCH] A better fix for slurp, expand path in the module. --- lib/ansible/runner.py | 3 ++- library/slurp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ansible/runner.py b/lib/ansible/runner.py index 323ebe71221..2a49b9bbfc1 100755 --- a/lib/ansible/runner.py +++ b/lib/ansible/runner.py @@ -471,7 +471,8 @@ class Runner(object): if self.remote_user == 'root': metadata = '/etc/ansible/setup' else: - metadata = "/home/%s/.ansible/setup" % self.remote_user + # path is expanded on remote side + metadata = "~/.ansible/setup" # install the template module slurp_module = self._transfer_module(conn, tmp, 'slurp') diff --git a/library/slurp b/library/slurp index ab0c879db39..36e84ecc09d 100755 --- a/library/slurp +++ b/library/slurp @@ -42,7 +42,7 @@ params = {} for x in items: (k, v) = x.split("=") params[k] = v -source = params['src'] +source = os.path.expanduser(params['src']) # ==========================================