summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2016-06-29 02:52:49 +0200
committerGuilhem Moulin <guilhem@fripost.org>2016-06-29 02:52:49 +0200
commitc50364d5852de7446462d0b986d72dc2786df6eb (patch)
tree4006e60ab72b2e875a3d07e4bd78b14a52fc73a8
parentb26aa6a670ea30442e1a8134914b2c7976dc1753 (diff)
ansible: _make_tmp_path now takes an argument.
-rw-r--r--lib/action_plugins/fetch_cmd.py3
-rw-r--r--lib/action_plugins/openldap.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/action_plugins/fetch_cmd.py b/lib/action_plugins/fetch_cmd.py
index 99bdf2e..b460868 100644
--- a/lib/action_plugins/fetch_cmd.py
+++ b/lib/action_plugins/fetch_cmd.py
@@ -42,7 +42,8 @@ class ActionModule(ActionBase):
stdin = self._connection._shell.join_path(stdin)
stdin = self._remote_expand_user(stdin)
- stdout = self._connection._shell.join_path(self._make_tmp_path(), 'stdout')
+ remote_user = task_vars.get('ansible_ssh_user') or self._play_context.remote_user
+ stdout = self._connection._shell.join_path(self._make_tmp_path(remote_user), 'stdout')
result.update(self._execute_module(module_args=dict(cmd=cmd, stdin=stdin, dest=stdout), task_vars=task_vars))
# calculate checksum for the local file
diff --git a/lib/action_plugins/openldap.py b/lib/action_plugins/openldap.py
index a66c3aa..ad77abc 100644
--- a/lib/action_plugins/openldap.py
+++ b/lib/action_plugins/openldap.py
@@ -47,8 +47,9 @@ class ActionModule(ActionBase):
else:
target = self._loader.path_dwim_relative(self._loader.get_basedir(), local+'s', target)
+ remote_user = task_vars.get('ansible_ssh_user') or self._play_context.remote_user
new_module_args = self._task.args.copy()
- new_module_args['target'] = self._connection._shell.join_path(self._make_tmp_path(), 'target.ldif')
+ new_module_args['target'] = self._connection._shell.join_path(self._make_tmp_path(remote_user), 'target.ldif')
new_module_args['local'] = 'no'
if local == 'template':