diff --git a/ansible/shell_plugins/docker.py b/ansible/shell_plugins/docker.py index f3e5443978e..ca9f2d6aebf 100644 --- a/ansible/shell_plugins/docker.py +++ b/ansible/shell_plugins/docker.py @@ -24,7 +24,7 @@ def join_path(self, *args): ## We observe the interactions between ShellModule and ActionModule, and ## find the temporary directories Ansible created on remote machine. So we ## collect them and copied to docker container in build_module_command - if len(args) >= 2 and args[0].startswith('/home/') and args[1] == '': + if len(args) >= 2 and (args[0].startswith('/home/') or args[0].startswith('/root/')) and args[1] == '': self.dtemps.append(args[0]) return super(ShellModule, self).join_path(*args)