Skip to content

Instantly share code, notes, and snippets.

@amenonsen
Created November 3, 2015 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amenonsen/a8131bf563524f694186 to your computer and use it in GitHub Desktop.
Save amenonsen/a8131bf563524f694186 to your computer and use it in GitHub Desktop.
diff --git a/lib/ansible/plugins/connection/ssh.py b/lib/ansible/plugins/connection/ssh.py
index 73689aa..77b1f8d 100644
--- a/lib/ansible/plugins/connection/ssh.py
+++ b/lib/ansible/plugins/connection/ssh.py
@@ -404,6 +404,8 @@ class Connection(ConnectionBase):
if not rfd:
if state <= states.index('awaiting_escalation'):
+ if p.poll() is not None:
+ break
self._terminate_process(p)
raise AnsibleError('Timeout (%ds) waiting for privilege escalation prompt: %s' % (timeout, stdout))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment