I resolved this problem by add timeout in runner/connection_plugins/ssh.py,
such as:
157 import time
158 start = time.time()
159 TIMEOUT = self.runner.timeout*2
160 while True:
161 rfd, wfd, efd = select.select(rpipes, [], rpipes, 1)
162
163 # fail early if the sudo/su password is wrong
164 if self.runner.sudo and sudoable:
165 if self.runner.sudo_pass:
166 incorrect_password = gettext.dgettext(
167 "sudo", "Sorry, try again.")
168 if stdout.endswith("%s\r\n%s" % (incorrect_password,
169 prompt)):
170 raise errors.AnsibleError('Incorrect sudo
password')
171
172 if stdout.endswith(prompt):
173 raise errors.AnsibleError('Missing sudo password')
174
175 if self.runner.su and su and self.runner.su_pass:
176 incorrect_password = gettext.dgettext(
177 "su", "Sorry")
178 if stdout.endswith("%s\r\n%s" % (incorrect_password,
prompt)):
179 raise errors.AnsibleError('Incorrect su password')
180
181 end = time.time()
182 if TIMEOUT <= (end - start):
183 raise errors.AnsibleError('Read ssh stdin timeout')
Is there any way to resolve that?
Thank you.
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/3785515f-d20b-4281-ae3c-94678a123719%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.