diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index 8f8c3276d1..f0a8012f47 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -363,7 +363,10 @@ class Runner(object): return flags try: - self._new_stdin = new_stdin + if not new_stdin: + self._new_stdin = os.fdopen(os.dup(sys.stdin.fileno())) + else: + self._new_stdin = new_stdin exec_rc = self._executor_internal(host, new_stdin) if type(exec_rc) != ReturnData: