From b2dc66c7ea759127c86a4b5ffa61ca5d000dc5de Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 30 Jul 2015 13:11:41 -0400 Subject: [PATCH] now check stderr also on become for ssh plugin for the cases where sudo or su do not want to prompt/echo on stdin fixes #11796 --- lib/ansible/plugins/connections/ssh.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/plugins/connections/ssh.py b/lib/ansible/plugins/connections/ssh.py index b0b8a3db7d4..1a520128fcc 100644 --- a/lib/ansible/plugins/connections/ssh.py +++ b/lib/ansible/plugins/connections/ssh.py @@ -377,7 +377,7 @@ class Connection(ConnectionBase): become_errput = '' while True: self._display.debug('Waiting for Privilege Escalation input') - if self.check_become_success(become_output) or self.check_password_prompt(become_output): + if self.check_become_success(become_output + become_errput) or self.check_password_prompt(become_output + become_errput): break rfd, wfd, efd = select.select([p.stdout, p.stderr], [], [p.stdout], self._play_context.timeout) @@ -398,7 +398,7 @@ class Connection(ConnectionBase): if not chunk: raise AnsibleError('Connection closed waiting for privilege escalation password prompt: %s ' % become_output) - if not self.check_become_success(become_output): + if not self.check_become_success(become_output + become_errput): self._display.debug("Sending privilege escalation password.") stdin.write(self._play_context.become_pass + '\n') else: