Repository: ansible/ansible

Issue:
AnsibleConnectionFailure("timeout trying to send command: %s" % command.strip())
<!---
Verify first that your issue/request is not already reported on GitHub.
Also test if the latest release, and master branch are affected too.
-->

##### ISSUE TYPE
<!--- Pick one below and delete the rest -->
 - Bug Report

##### COMPONENT NAME
<!---
Name of the module, plugin, task or feature
Do not include extra details here, e.g. "vyos_command" not "the network module vyos_command" or the full path
-->
File "/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/connection/network_cli.py", line 302, in send
##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes below -->
```
ansible 2.5.0
  config file = /Users/bklotz/.ansible.cfg
  configured module search path = [u'/Users/bklotz/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible
  executable location = /Users/bklotz/miniconda2/bin/ansible
  python version = 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:05:08) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
```

##### CONFIGURATION
<!---
If using Ansible 2.4 or above, paste the results of "ansible-config dump --only-changed"
Otherwise, mention any settings you have changed/added/removed in ansible.cfg
(or using the ANSIBLE_* environment variables).
-->
DEFAULT_DEBUG(env: ANSIBLE_DEBUG) = False
DEFAULT_LOG_PATH(env: ANSIBLE_LOG_PATH) = /Users/bklotz/ansible.log
HOST_KEY_CHECKING(/Users/bklotz/.ansible.cfg) = False
##### OS / ENVIRONMENT
<!---
Mention the OS you are running Ansible from, and the OS you are
managing, or say "N/A" for anything that is not platform-specific.
Also mention the specific version of what you are trying to control,
e.g. if this is a network bug the version of firmware on the network device.
-->
Mac OS X
##### SUMMARY
<!--- Explain the problem briefly -->
Attempting to use simple playbook to change the ip name-servers on Cisco 3850 switches.
##### STEPS TO REPRODUCE
<!---
For bugs, show exactly how to reproduce the problem, using a minimal test-case.
For new features, show how the feature would be used.
-->
Cisco switches, using tacacs for authentication.
<!--- Paste example playbooks or commands between quotes below -->
```yaml
#Playbook
---

- name: Set Anycast name servers
  hosts: first_fl
  gather_facts: no
  tasks:
    - ios_system:
        name_servers:
          - 10.9.8.7
          - 10.9.8.8

# Inventory
[all:vars]
ansible_python_interpreter=/Users/bklotz/miniconda2/bin/python

[basement]
NKNAWHQNWA00DX01
NKNAWHQNWB00DX01
NKNAWHQNWA00AX01
NKNAWHQNWB00AX01

[first_fl]
NKNAWHQNWA01AX01
NKNAWHQNWC01AX01
NKNAWHQNWD01AX01

[second_fl]
NKNAWHQNWA02AX01
NKNAWHQNWA02AX02
NKNAWHQNWC02AX01
NKNAWHQNWD02AX01

[third_fl]
NKNAWHQNWA03AX01
NKNAWHQNWA03AX02
NKNAWHQNWB03AX01
NKNAWHQNWC03AX01
NKNAWHQNWD03AX01

[fourth_fl]
NKNAWHQNWA04AX01
NKNAWHQNWA04AX02
NKNAWHQNWB04AX01
NKNAWHQNWC04AX01
NKNAWHQNWD04AX01

[fifth_fl]
NKNAWHQNWA05AX01
NKNAWHQNWA05AX02
NKNAWHQNWB05AX01
NKNAWHQNWC05AX01
NKNAWHQNWD05AX01
NKNAWHQNWD05AX02

# Variables
---
ansible_connection: network_cli
ansible_network_os: ios
ansible_become: yes
ansible_become_method: enable
ansible_user: s.prime
ansible_ssh_pass: REDACTED
ansible_become_pass: REDACTED

```

<!--- You can also paste gist.github.com links for larger files -->

##### EXPECTED RESULTS
<!--- What did you expect to happen when running the steps above? -->
Success in changing the ip name-servers to requested IPs.

##### ACTUAL RESULTS

<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->
```
2017-12-18 07:33:18,341 p=2129 u=bklotz |  ansible-playbook 2.5.0
  config file = /Users/bklotz/.ansible.cfg
  configured module search path = [u'/Users/bklotz/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible
  executable location = /Users/bklotz/miniconda2/bin/ansible-playbook
  python version = 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:05:08) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
2017-12-18 07:33:18,342 p=2129 u=bklotz |  Using /Users/bklotz/.ansible.cfg as config file
2017-12-18 07:33:18,342 p=2129 u=bklotz |  setting up inventory plugins
2017-12-18 07:33:18,392 p=2129 u=bklotz |  Parsed /Users/bklotz/Box Sync/Python/ansible-northwoods/nw-hosts inventory source with ini plugin
2017-12-18 07:33:18,528 p=2129 u=bklotz |  Loading callback plugin default of type stdout, v2.0 from /Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/callback/default.pyc
2017-12-18 07:33:18,769 p=2129 u=bklotz |  PLAYBOOK: testing.yml **************************************************************************************************
2017-12-18 07:33:18,769 p=2129 u=bklotz |  1 plays in testing.yml
2017-12-18 07:33:18,810 p=2129 u=bklotz |  PLAY [Set Anycast name servers] ****************************************************************************************
2017-12-18 07:33:18,858 p=2129 u=bklotz |  META: ran handlers
2017-12-18 07:33:18,865 p=2129 u=bklotz |  TASK [ios_system] ******************************************************************************************************
2017-12-18 07:33:18,865 p=2129 u=bklotz |  task path: /Users/bklotz/Box Sync/Python/ansible-northwoods/testing.yml:7
2017-12-18 07:33:19,967 paramiko.transport starting thread (client mode): 0x41c7910L
2017-12-18 07:33:19,968 paramiko.transport Local version/idstring: SSH-2.0-paramiko_2.4.0
2017-12-18 07:33:19,969 paramiko.transport Remote version/idstring: SSH-2.0-Cisco-1.25
2017-12-18 07:33:19,969 paramiko.transport Connected (version 2.0, client Cisco-1.25)
2017-12-18 07:33:19,972 paramiko.transport kex algos:[u'diffie-hellman-group-exchange-sha1', u'diffie-hellman-group14-sha1', u'diffie-hellman-group1-sha1'] server key:[u'ssh-rsa'] client encrypt:[u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'aes128-cbc', u'3des-cbc', u'aes192-cbc', u'aes256-cbc'] server encrypt:[u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'aes128-cbc', u'3des-cbc', u'aes192-cbc', u'aes256-cbc'] client mac:[u'hmac-sha1', u'hmac-sha1-96'] server mac:[u'hmac-sha1', u'hmac-sha1-96'] client compress:[u'none'] server compress:[u'none'] client lang:[u''] server lang:[u''] kex follows?False
2017-12-18 07:33:19,973 paramiko.transport Kex agreed: diffie-hellman-group-exchange-sha1
2017-12-18 07:33:19,973 paramiko.transport HostKey agreed: ssh-rsa
2017-12-18 07:33:19,973 paramiko.transport Cipher agreed: aes128-ctr
2017-12-18 07:33:19,974 paramiko.transport MAC agreed: hmac-sha1
2017-12-18 07:33:19,974 paramiko.transport Compression agreed: none
2017-12-18 07:33:20,180 paramiko.transport Got server p (2048 bits)
2017-12-18 07:33:20,491 paramiko.transport kex engine KexGex specified hash_algo <built-in function openssl_sha1>
2017-12-18 07:33:20,493 paramiko.transport Switch to new keys ...
2017-12-18 07:33:20,699 paramiko.transport userauth is OK
2017-12-18 07:33:20,700 paramiko.transport Auth banner: 
********************************************************
* WARNING
* This system is owned by Nike, Inc. If you are not
* authorized to access this system, exit immediately.
* Unauthorized access to this system is forbidden by
* company policies, national, and international laws.
* Unauthorized users are subject to criminal and civil
* penalties as well as company initiated disciplinary
* proceedings.
********************************************************

2017-12-18 07:33:20,740 paramiko.transport Authentication (password) successful!
2017-12-18 07:33:20,767 paramiko.transport [chan 0] Max packet in: 32768 bytes
2017-12-18 07:33:20,772 paramiko.transport [chan 0] Max packet out: 4096 bytes
2017-12-18 07:33:20,773 paramiko.transport Secsh channel 0 opened.
2017-12-18 07:33:20,781 paramiko.transport [chan 0] Sesch channel 0 request ok
2017-12-18 07:33:20,786 paramiko.transport [chan 0] Sesch channel 0 request ok
2017-12-18 07:33:41,332 p=2136 u=bklotz |  shutdown complete
2017-12-18 07:33:41,419 paramiko.transport EOF in transport thread
2017-12-18 07:33:42,002 p=2129 u=bklotz |  Traceback (most recent call last):
  File "/Users/bklotz/miniconda2/bin/ansible-connection", line 72, in start
    self.connection._connect()
  File "/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/connection/network_cli.py", line 208, in _connect
    self._terminal.on_become(passwd=auth_pass)
  File "/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/terminal/ios.py", line 72, in on_become
    prompt = self._get_prompt()
  File "/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/terminal/__init__.py", line 74, in _get_prompt
    self._exec_cli_command(b'')
  File "/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/terminal/__init__.py", line 64, in _exec_cli_command
    return self._connection.exec_command(cmd)
  File "/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/connection/network_cli.py", line 130, in exec_command
    return self.send(command=cmd)
  File "/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/connection/network_cli.py", line 302, in send
    raise AnsibleConnectionFailure("timeout trying to send command: %s" % command.strip())
AnsibleConnectionFailure: timeout trying to send command: 

2017-12-18 07:33:42,007 p=2129 u=bklotz |  fatal: [NKNAWHQNWA01AX01]: FAILED! => {
    "msg": "timeout trying to send command: "
}
2017-12-18 07:33:42,012 p=2129 u=bklotz |  	to retry, use: --limit @/Users/bklotz/Box Sync/Python/ansible-northwoods/testing.retry

2017-12-18 07:33:42,012 p=2129 u=bklotz |  PLAY RECAP *************************************************************************************************************
2017-12-18 07:33:42,013 p=2129 u=bklotz |  NKNAWHQNWA01AX01           : ok=0    changed=0    unreachable=0    failed=1   
```

<!--- Paste verbatim command output between quotes below -->
```
[bklotz ansible-northwoods]$ ansible-playbook -i nw-hosts testing.yml --limit=NKNAWHQNWA01AX01 -vvvv
ansible-playbook 2.5.0
  config file = /Users/bklotz/.ansible.cfg
  configured module search path = [u'/Users/bklotz/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible
  executable location = /Users/bklotz/miniconda2/bin/ansible-playbook
  python version = 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:05:08) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
Using /Users/bklotz/.ansible.cfg as config file
setting up inventory plugins
Parsed /Users/bklotz/Box Sync/Python/ansible-northwoods/nw-hosts inventory source with ini plugin
Loading callback plugin default of type stdout, v2.0 from /Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/callback/default.pyc

PLAYBOOK: testing.yml **************************************************************************************************
1 plays in testing.yml

PLAY [Set Anycast name servers] ****************************************************************************************
META: ran handlers

TASK [ios_system] ******************************************************************************************************
task path: /Users/bklotz/Box Sync/Python/ansible-northwoods/testing.yml:7
<NKNAWHQNWA01AX01> attempting to start connection
<NKNAWHQNWA01AX01> using connection plugin network_cli
<NKNAWHQNWA01AX01> local domain socket does not exist, starting it
<NKNAWHQNWA01AX01> control socket path is /Users/bklotz/.ansible/pc/c00f439313
Traceback (most recent call last):
  File "/Users/bklotz/miniconda2/bin/ansible-connection", line 72, in start
    self.connection._connect()
  File "/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/connection/network_cli.py", line 208, in _connect
    self._terminal.on_become(passwd=auth_pass)
  File "/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/terminal/ios.py", line 72, in on_become
    prompt = self._get_prompt()
  File "/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/terminal/__init__.py", line 74, in _get_prompt
    self._exec_cli_command(b'')
  File "/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/terminal/__init__.py", line 64, in _exec_cli_command
    return self._connection.exec_command(cmd)
  File "/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/connection/network_cli.py", line 130, in exec_command
    return self.send(command=cmd)
  File "/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/connection/network_cli.py", line 302, in send
    raise AnsibleConnectionFailure("timeout trying to send command: %s" % command.strip())
AnsibleConnectionFailure: timeout trying to send command: 
fatal: [NKNAWHQNWA01AX01]: FAILED! => {
    "msg": "timeout trying to send command: "
}
        to retry, use: --limit @/Users/bklotz/Box Sync/Python/ansible-northwoods/testing.retry

PLAY RECAP *************************************************************************************************************
NKNAWHQNWA01AX01           : ok=0    changed=0    unreachable=0    failed=1   

```



Discussion:
Files identified in the description:
* [lib/ansible/plugins/connection/network_cli.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/connection/network_cli.py)

If these files are inaccurate, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
cc @Qalthos @ganeshrn @gundalow @kedarX @privateip @rcarrillocruz @trishnaguha
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: notify --->
Alright, I can't reproduce what you're seeing, but I think I know what the issue is. Can you tell me if #34101 fixes this issue for you?
Updated to devel branch, and issue persists.

2017-12-20 09:41:15,063 p=96821 u=bklotz |  ansible-playbook 2.5.0
  config file = /Users/bklotz/.ansible.cfg
  configured module search path =
[u'/Users/bklotz/.ansible/plugins/modules',
u'/usr/share/ansible/plugins/modules']
  ansible python module location =
/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible
  executable location = /Users/bklotz/miniconda2/bin/ansible-playbook
  python version = 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20
2016, 23:05:08) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
2017-12-20 09:41:15,064 p=96821 u=bklotz |  Using
/Users/bklotz/.ansible.cfg as config file
2017-12-20 09:41:15,064 p=96821 u=bklotz |  setting up inventory plugins
2017-12-20 09:41:15,114 p=96821 u=bklotz |  Parsed /Users/bklotz/Box
Sync/Python/ansible-northwoods/nw-hosts inventory source with ini plugin
2017-12-20 09:41:15,485 p=96821 u=bklotz |  Loading callback plugin default
of type stdout, v2.0 from
/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/callback/default.pyc
2017-12-20 09:41:15,751 p=96821 u=bklotz |  PLAYBOOK: testing.yml
**************************************************************************************************
2017-12-20 09:41:15,752 p=96821 u=bklotz |  1 plays in testing.yml
2017-12-20 09:41:15,791 p=96821 u=bklotz |  PLAY [Set Anycast name servers]
****************************************************************************************
2017-12-20 09:41:15,832 p=96821 u=bklotz |  META: ran handlers
2017-12-20 09:41:15,839 p=96821 u=bklotz |  TASK [ios_system]
******************************************************************************************************
2017-12-20 09:41:15,839 p=96821 u=bklotz |  task path: /Users/bklotz/Box
Sync/Python/ansible-northwoods/testing.yml:7
2017-12-20 09:41:16,920 paramiko.transport starting thread (client mode):
0x61249d0L
2017-12-20 09:41:16,920 paramiko.transport Local version/idstring:
SSH-2.0-paramiko_2.4.0
2017-12-20 09:41:16,923 paramiko.transport Remote version/idstring:
SSH-2.0-Cisco-1.25
2017-12-20 09:41:16,924 paramiko.transport Connected (version 2.0, client
Cisco-1.25)
2017-12-20 09:41:16,924 paramiko.transport kex
algos:[u'diffie-hellman-group-exchange-sha1',
u'diffie-hellman-group14-sha1', u'diffie-hellman-group1-sha1'] server
key:[u'ssh-rsa'] client encrypt:[u'aes128-ctr', u'aes192-ctr',
u'aes256-ctr', u'aes128-cbc', u'3des-cbc', u'aes192-cbc', u'aes256-cbc']
server encrypt:[u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'aes128-cbc',
u'3des-cbc', u'aes192-cbc', u'aes256-cbc'] client mac:[u'hmac-sha1',
u'hmac-sha1-96'] server mac:[u'hmac-sha1', u'hmac-sha1-96'] client
compress:[u'none'] server compress:[u'none'] client lang:[u''] server
lang:[u''] kex follows?False
2017-12-20 09:41:16,924 paramiko.transport Kex agreed:
diffie-hellman-group-exchange-sha1
2017-12-20 09:41:16,924 paramiko.transport HostKey agreed: ssh-rsa
2017-12-20 09:41:16,924 paramiko.transport Cipher agreed: aes128-ctr
2017-12-20 09:41:16,925 paramiko.transport MAC agreed: hmac-sha1
2017-12-20 09:41:16,925 paramiko.transport Compression agreed: none
2017-12-20 09:41:17,124 paramiko.transport Got server p (2048 bits)
2017-12-20 09:41:17,432 paramiko.transport kex engine KexGex specified
hash_algo <built-in function openssl_sha1>
2017-12-20 09:41:17,433 paramiko.transport Switch to new keys ...
2017-12-20 09:41:17,637 paramiko.transport userauth is OK
2017-12-20 09:41:17,639 paramiko.transport Auth banner:
********************************************************
* WARNING
* This system is owned by Nike, Inc. If you are not
* authorized to access this system, exit immediately.
* Unauthorized access to this system is forbidden by
* company policies, national, and international laws.
* Unauthorized users are subject to criminal and civil
* penalties as well as company initiated disciplinary
* proceedings.
********************************************************

2017-12-20 09:41:17,667 paramiko.transport Authentication (password)
successful!
2017-12-20 09:41:17,673 paramiko.transport [chan 0] Max packet in: 32768
bytes
2017-12-20 09:41:17,678 paramiko.transport [chan 0] Max packet out: 4096
bytes
2017-12-20 09:41:17,678 paramiko.transport Secsh channel 0 opened.
2017-12-20 09:41:17,686 paramiko.transport [chan 0] Sesch channel 0 request
ok
2017-12-20 09:41:17,692 paramiko.transport [chan 0] Sesch channel 0 request
ok
2017-12-20 09:41:38,231 p=96828 u=bklotz |  shutdown complete
2017-12-20 09:41:38,329 paramiko.transport EOF in transport thread
2017-12-20 09:41:38,885 p=96821 u=bklotz |  Traceback (most recent call
last):
  File "/Users/bklotz/miniconda2/bin/ansible-connection", line 72, in start
    self.connection._connect()
  File
"/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/connection/network_cli.py",
line 210, in _connect
    self._terminal.on_become(passwd=auth_pass)
  File
"/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/terminal/ios.py",
line 72, in on_become
    prompt = self._get_prompt()
  File
"/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/terminal/__init__.py",
line 74, in _get_prompt
    self._exec_cli_command(b'')
  File
"/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/terminal/__init__.py",
line 64, in _exec_cli_command
    return self._connection.exec_command(cmd)
  File
"/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/connection/network_cli.py",
line 132, in exec_command
    return self.send(command=cmd)
  File
"/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/connection/network_cli.py",
line 304, in send
    raise AnsibleConnectionFailure("timeout trying to send command: %s" %
command.strip())
AnsibleConnectionFailure: timeout trying to send command:

2017-12-20 09:41:38,891 p=96821 u=bklotz |  fatal: [NKNAWHQNWA01AX01]:
FAILED! => {
    "msg": "timeout trying to send command: "
}
2017-12-20 09:41:38,894 p=96821 u=bklotz |  to retry, use: --limit
@/Users/bklotz/Box Sync/Python/ansible-northwoods/testing.retry

2017-12-20 09:41:38,894 p=96821 u=bklotz |  PLAY RECAP
*************************************************************************************************************
2017-12-20 09:41:38,894 p=96821 u=bklotz |  NKNAWHQNWA01AX01           :
ok=0    changed=0    unreachable=0    failed=1


On Wed, Dec 20, 2017 at 9:28 AM Nathaniel Case <notifications@github.com>
wrote:

> Alright, I can't reproduce what you're seeing, but can you tell me if
> #34101 <https://github.com/ansible/ansible/pull/34101> fixes this issue
> for you?
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/ansible/ansible/issues/33993#issuecomment-353128664>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AbFU9nrHKdBopRANScVFM-HYezM1jvW1ks5tCUPOgaJpZM4RFrMW>
> .
>
-- 
"Have you tried turning it off and on again?"

Sorry for not being clearer, it hasn't been merged yet. Is it possible for you to check out that branch and test that? I'm nearly certain this is the issue, I just want to be sure.
I'd love to, but am not sure how to find that branch. Can you help me with
the syntax to pull it? I have been using:

sudo -H pip install git+https://github.com/ansible/ansible.git@devel
--upgrade

On Wed, Dec 20, 2017 at 2:56 PM Nathaniel Case <notifications@github.com>
wrote:

> Sorry for not being clearer, it hasn't been merged yet. Is it possible for
> you to check out that branch and test that? I'm nearly certain this is the
> issue, I just want to be sure.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/ansible/ansible/issues/33993#issuecomment-353206884>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AbFU9owMo3qBeSmz6tgRGP3c8r10AKY0ks5tCZCHgaJpZM4RFrMW>
> .
>
-- 
"Have you tried turning it off and on again?"

That appears to be `pip install git+https://github.com/Qalthos/ansible.git@restore-prompt --upgrade`
Back to my original issue:

2017-12-22 10:03:27,192 p=14705 u=bklotz |  ansible-playbook 2.5.0
  config file = /Users/bklotz/.ansible.cfg
  configured module search path =
[u'/Users/bklotz/.ansible/plugins/modules',
u'/usr/share/ansible/plugins/modules']
  ansible python module location =
/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible
  executable location = /Users/bklotz/miniconda2/bin/ansible-playbook
  python version = 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20
2016, 23:05:08) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
2017-12-22 10:03:27,193 p=14705 u=bklotz |  Using
/Users/bklotz/.ansible.cfg as config file
2017-12-22 10:03:27,193 p=14705 u=bklotz |  setting up inventory plugins
2017-12-22 10:03:27,242 p=14705 u=bklotz |  Parsed /Users/bklotz/Box
Sync/Python/ansible-northwoods/nw-hosts inventory source with ini plugin
2017-12-22 10:03:27,678 p=14705 u=bklotz |  Loading callback plugin default
of type stdout, v2.0 from
/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/callback/default.pyc
2017-12-22 10:03:27,941 p=14705 u=bklotz |  PLAYBOOK: testing.yml
**************************************************************************************************
2017-12-22 10:03:27,941 p=14705 u=bklotz |  1 plays in testing.yml
2017-12-22 10:03:27,976 p=14705 u=bklotz |  PLAY [Set Anycast name servers]
****************************************************************************************
2017-12-22 10:03:28,020 p=14705 u=bklotz |  META: ran handlers
2017-12-22 10:03:28,025 p=14705 u=bklotz |  TASK [ios_system]
******************************************************************************************************
2017-12-22 10:03:28,025 p=14705 u=bklotz |  task path: /Users/bklotz/Box
Sync/Python/ansible-northwoods/testing.yml:7
2017-12-22 10:03:29,151 paramiko.transport starting thread (client mode):
0x10bd29d0L
2017-12-22 10:03:29,151 paramiko.transport Local version/idstring:
SSH-2.0-paramiko_2.4.0
2017-12-22 10:03:29,173 paramiko.transport Remote version/idstring:
SSH-2.0-Cisco-1.25
2017-12-22 10:03:29,173 paramiko.transport Connected (version 2.0, client
Cisco-1.25)
2017-12-22 10:03:29,178 paramiko.transport kex
algos:[u'diffie-hellman-group-exchange-sha1',
u'diffie-hellman-group14-sha1', u'diffie-hellman-group1-sha1'] server
key:[u'ssh-rsa'] client encrypt:[u'aes128-ctr', u'aes192-ctr',
u'aes256-ctr', u'aes128-cbc', u'3des-cbc', u'aes192-cbc', u'aes256-cbc']
server encrypt:[u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'aes128-cbc',
u'3des-cbc', u'aes192-cbc', u'aes256-cbc'] client mac:[u'hmac-sha1',
u'hmac-sha1-96'] server mac:[u'hmac-sha1', u'hmac-sha1-96'] client
compress:[u'none'] server compress:[u'none'] client lang:[u''] server
lang:[u''] kex follows?False
2017-12-22 10:03:29,178 paramiko.transport Kex agreed:
diffie-hellman-group-exchange-sha1
2017-12-22 10:03:29,178 paramiko.transport HostKey agreed: ssh-rsa
2017-12-22 10:03:29,179 paramiko.transport Cipher agreed: aes128-ctr
2017-12-22 10:03:29,179 paramiko.transport MAC agreed: hmac-sha1
2017-12-22 10:03:29,179 paramiko.transport Compression agreed: none
2017-12-22 10:03:29,426 paramiko.transport Got server p (2048 bits)
2017-12-22 10:03:29,740 paramiko.transport kex engine KexGex specified
hash_algo <built-in function openssl_sha1>
2017-12-22 10:03:29,742 paramiko.transport Switch to new keys ...
2017-12-22 10:03:30,034 paramiko.transport userauth is OK
2017-12-22 10:03:30,035 paramiko.transport Auth banner:
********************************************************
* WARNING
* This system is owned by Nike, Inc. If you are not
* authorized to access this system, exit immediately.
* Unauthorized access to this system is forbidden by
* company policies, national, and international laws.
* Unauthorized users are subject to criminal and civil
* penalties as well as company initiated disciplinary
* proceedings.
********************************************************

2017-12-22 10:03:30,092 paramiko.transport Authentication (password)
successful!
2017-12-22 10:03:30,122 paramiko.transport [chan 0] Max packet in: 32768
bytes
2017-12-22 10:03:30,149 paramiko.transport [chan 0] Max packet out: 4096
bytes
2017-12-22 10:03:30,150 paramiko.transport Secsh channel 0 opened.
2017-12-22 10:03:30,190 paramiko.transport [chan 0] Sesch channel 0 request
ok
2017-12-22 10:03:30,223 paramiko.transport [chan 0] Sesch channel 0 request
ok
2017-12-22 10:03:40,662 p=14712 u=bklotz |  shutdown complete
2017-12-22 10:03:40,754 paramiko.transport EOF in transport thread
2017-12-22 10:03:41,302 p=14705 u=bklotz |  Traceback (most recent call
last):
  File "/Users/bklotz/miniconda2/bin/ansible-connection", line 72, in start
    self.connection._connect()
  File
"/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/connection/network_cli.py",
line 210, in _connect
    self._terminal.on_become(passwd=auth_pass)
  File
"/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/terminal/ios.py",
line 69, in on_become
    raise AnsibleConnectionFailure('unable to elevate privilege to enable
mode')
AnsibleConnectionFailure: unable to elevate privilege to enable mode

2017-12-22 10:03:41,317 p=14705 u=bklotz |  fatal: [NKNAWHQNWA01AX01]:
FAILED! => {
    "msg": "unable to elevate privilege to enable mode"
}
2017-12-22 10:03:41,328 p=14705 u=bklotz |  to retry, use: --limit
@/Users/bklotz/Box Sync/Python/ansible-northwoods/testing.retry

2017-12-22 10:03:41,329 p=14705 u=bklotz |  PLAY RECAP
*************************************************************************************************************
2017-12-22 10:03:41,366 p=14705 u=bklotz |  NKNAWHQNWA01AX01           :
ok=0    changed=0    unreachable=0    failed=1


On Wed, Dec 20, 2017 at 7:26 PM Nathaniel Case <notifications@github.com>
wrote:

> That appears to be pip install git+
> https://github.com/Qalthos/ansible.git@restore-prompt --upgrade
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/ansible/ansible/issues/33993#issuecomment-353248472>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AbFU9t-lo4IzuRsGhFA0x_R58TpsHk4vks5tCc_IgaJpZM4RFrMW>
> .
>
-- 
"Have you tried turning it off and on again?"

I updated using "sudo pip install git+https://github.com/Qalthos/ansible.git@restore-prompt --upgrade" and now have the issue again:

2018-01-02 07:51:24,438 p=1938 u=bklotz |  ansible-playbook 2.5.0
  config file = /Users/bklotz/.ansible.cfg
  configured module search path = [u'/Users/bklotz/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible
  executable location = /Users/bklotz/miniconda2/bin/ansible-playbook
  python version = 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:05:08) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
2018-01-02 07:51:24,438 p=1938 u=bklotz |  Using /Users/bklotz/.ansible.cfg as config file
2018-01-02 07:51:24,439 p=1938 u=bklotz |  setting up inventory plugins
2018-01-02 07:51:24,481 p=1938 u=bklotz |  Parsed /Users/bklotz/Box Sync/Python/ansible-northwoods/nw-hosts inventory source with ini plugin
2018-01-02 07:51:24,586 p=1938 u=bklotz |  Loading callback plugin default of type stdout, v2.0 from /Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/callback/default.pyc
2018-01-02 07:51:24,765 p=1938 u=bklotz |  PLAYBOOK: testing.yml **************************************************************************************************
2018-01-02 07:51:24,765 p=1938 u=bklotz |  1 plays in testing.yml
2018-01-02 07:51:24,787 p=1938 u=bklotz |  PLAY [Set Anycast name servers] ****************************************************************************************
2018-01-02 07:51:24,819 p=1938 u=bklotz |  META: ran handlers
2018-01-02 07:51:24,828 p=1938 u=bklotz |  TASK [ios_system] ******************************************************************************************************
2018-01-02 07:51:24,828 p=1938 u=bklotz |  task path: /Users/bklotz/Box Sync/Python/ansible-northwoods/testing.yml:7
2018-01-02 07:51:25,704 paramiko.transport starting thread (client mode): 0xb9d8a50L
2018-01-02 07:51:25,704 paramiko.transport Local version/idstring: SSH-2.0-paramiko_2.4.0
2018-01-02 07:51:25,708 paramiko.transport Remote version/idstring: SSH-2.0-Cisco-1.25
2018-01-02 07:51:25,709 paramiko.transport Connected (version 2.0, client Cisco-1.25)
2018-01-02 07:51:25,709 paramiko.transport kex algos:[u'diffie-hellman-group-exchange-sha1', u'diffie-hellman-group14-sha1', u'diffie-hellman-group1-sha1'] server key:[u'ssh-rsa'] client encrypt:[u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'aes128-cbc', u'3des-cbc', u'aes192-cbc', u'aes256-cbc'] server encrypt:[u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'aes128-cbc', u'3des-cbc', u'aes192-cbc', u'aes256-cbc'] client mac:[u'hmac-sha1', u'hmac-sha1-96'] server mac:[u'hmac-sha1', u'hmac-sha1-96'] client compress:[u'none'] server compress:[u'none'] client lang:[u''] server lang:[u''] kex follows?False
2018-01-02 07:51:25,710 paramiko.transport Kex agreed: diffie-hellman-group-exchange-sha1
2018-01-02 07:51:25,710 paramiko.transport HostKey agreed: ssh-rsa
2018-01-02 07:51:25,710 paramiko.transport Cipher agreed: aes128-ctr
2018-01-02 07:51:25,710 paramiko.transport MAC agreed: hmac-sha1
2018-01-02 07:51:25,710 paramiko.transport Compression agreed: none
2018-01-02 07:51:25,918 paramiko.transport Got server p (2048 bits)
2018-01-02 07:51:26,253 paramiko.transport kex engine KexGex specified hash_algo <built-in function openssl_sha1>
2018-01-02 07:51:26,254 paramiko.transport Switch to new keys ...
2018-01-02 07:51:26,459 paramiko.transport userauth is OK
2018-01-02 07:51:26,460 paramiko.transport Auth banner: 
********************************************************
* WARNING
* This system is owned by Nike, Inc. If you are not
* authorized to access this system, exit immediately.
* Unauthorized access to this system is forbidden by
* company policies, national, and international laws.
* Unauthorized users are subject to criminal and civil
* penalties as well as company initiated disciplinary
* proceedings.
********************************************************

2018-01-02 07:51:26,504 paramiko.transport Authentication (password) successful!
2018-01-02 07:51:26,527 paramiko.transport [chan 0] Max packet in: 32768 bytes
2018-01-02 07:51:26,531 paramiko.transport [chan 0] Max packet out: 4096 bytes
2018-01-02 07:51:26,532 paramiko.transport Secsh channel 0 opened.
2018-01-02 07:51:26,545 paramiko.transport [chan 0] Sesch channel 0 request ok
2018-01-02 07:51:26,556 paramiko.transport [chan 0] Sesch channel 0 request ok
2018-01-02 07:51:47,410 p=1945 u=bklotz |  shutdown complete
2018-01-02 07:51:47,440 paramiko.transport EOF in transport thread
2018-01-02 07:51:48,109 p=1938 u=bklotz |  Traceback (most recent call last):
  File "/Users/bklotz/miniconda2/bin/ansible-connection", line 72, in start
    self.connection._connect()
  File "/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/connection/network_cli.py", line 210, in _connect
    self._terminal.on_become(passwd=auth_pass)
  File "/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/terminal/ios.py", line 72, in on_become
    prompt = self._get_prompt()
  File "/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/terminal/__init__.py", line 74, in _get_prompt
    self._exec_cli_command(b'')
  File "/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/terminal/__init__.py", line 64, in _exec_cli_command
    return self._connection.exec_command(cmd)
  File "/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/connection/network_cli.py", line 132, in exec_command
    return self.send(command=cmd)
  File "/Users/bklotz/miniconda2/lib/python2.7/site-packages/ansible/plugins/connection/network_cli.py", line 304, in send
    raise AnsibleConnectionFailure("timeout trying to send command: %s" % command.strip())
AnsibleConnectionFailure: timeout trying to send command: 

2018-01-02 07:51:48,117 p=1938 u=bklotz |  fatal: [NKNAWHQNWA01AX01]: FAILED! => {
    "msg": "timeout trying to send command: "
}
2018-01-02 07:51:48,121 p=1938 u=bklotz |  	to retry, use: --limit @/Users/bklotz/Box Sync/Python/ansible-northwoods/testing.retry

2018-01-02 07:51:48,122 p=1938 u=bklotz |  PLAY RECAP *************************************************************************************************************
2018-01-02 07:51:48,122 p=1938 u=bklotz |  NKNAWHQNWA01AX01           : ok=0    changed=0    unreachable=0    failed=1   

Using a special debug build, we can see that when the enable command is sent, ansible does not send the ansible_become_password regardless of how it is supplied (I tried in a group_vars/all.yml file, in the inventory file and via the command line with -e). When the password is not sent, ansible then sends a \r, which causes the switch to prompt "Enter Old Password:", as it assumes you wish to change your password at this point, which is not what is intended.

```2018-01-11 11:13:51,941 p=40342 u=bklotz |   40351 1515698031.94171: CLI-PROMPT: looking for prompt in | enable\r\n
2018-01-11 11:13:52,159 p=40342 u=bklotz |   40351 1515698032.15927: CLI-PROMPT: looking for prompts in | enable\r\nPassword:
2018-01-11 11:13:52,159 p=40342 u=bklotz |   40351 1515698032.15962: CLI-PROMPT: looking for prompt in | enable\r\nPassword:
2018-01-11 11:14:02,163 p=40342 u=bklotz |   40351 1515698042.16355: CLI-SEND: \r
2018-01-11 11:14:02,380 p=40342 u=bklotz |   40351 1515698042.38048: CLI-PROMPT: looking for prompts in | \r\nEnter Old Password:
2018-01-11 11:14:02,380 p=40342 u=bklotz |   40351 1515698042.38083: CLI-PROMPT: looking for prompt in | \r\nEnter Old Password:
```
@brainclots Can you please test this on latest devel branch? 
There recently has been a PR https://github.com/ansible/ansible/pull/34723 merged which might make this return a meaningful error message. 

To test against devel branch:
```
git clone https://github.com/ansible/ansible.git
source hacking/env-setup
```
Here is what I see on the command line when running the playbook with
'-vvvv':

The full traceback is:
Traceback (most recent call last):
  File "/Users/bklotz/ansible/bin/ansible-connection", line 70, in start
    self.connection._connect()
  File
"/Users/bklotz/ansible/lib/ansible/plugins/connection/network_cli.py", line
323, in _connect
    self._terminal.on_become(passwd=auth_pass)
  File "/Users/bklotz/ansible/lib/ansible/plugins/terminal/ios.py", line
75, in on_become
    prompt = self._get_prompt()
  File "/Users/bklotz/ansible/lib/ansible/plugins/terminal/__init__.py",
line 74, in _get_prompt
    self._exec_cli_command(b'')
  File "/Users/bklotz/ansible/lib/ansible/plugins/terminal/__init__.py",
line 64, in _exec_cli_command
    return self._connection.exec_command(cmd)
  File
"/Users/bklotz/ansible/lib/ansible/plugins/connection/network_cli.py", line
245, in exec_command
    return self.send(command=cmd)
  File
"/Users/bklotz/ansible/lib/ansible/plugins/connection/network_cli.py", line
421, in send
    raise AnsibleConnectionFailure("timeout trying to send command: %s" %
command.strip())
AnsibleConnectionFailure: timeout trying to send command:
fatal: [NKNAWHQNWA01AX01]: FAILED! => {
    "failed": true,
    "msg": "timeout trying to send command: "
}

Here are the entries in ansible.log:
2018-01-25 11:20:10,109 p=47423 u=bklotz |  ansible-playbook 2.5.0 (devel
7abdab6c9e) last updated 2018/01/25 11:07:23 (GMT -700)
  config file = /Users/bklotz/.ansible.cfg
  configured module search path =
[u'/Users/bklotz/.ansible/plugins/modules',
u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/bklotz/ansible/lib/ansible
  executable location = /Users/bklotz/ansible/bin/ansible-playbook
  python version = 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20
2016, 23:05:08) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
2018-01-25 11:20:10,110 p=47423 u=bklotz |  Using
/Users/bklotz/.ansible.cfg as config file
2018-01-25 11:20:10,110 p=47423 u=bklotz |  setting up inventory plugins
2018-01-25 11:20:10,163 p=47423 u=bklotz |  Parsed /Users/bklotz/Box
Sync/Python/ansible-northwoods/nw-hosts inventory source with ini plugin
2018-01-25 11:20:10,251 p=47423 u=bklotz |  Loading callback plugin default
of type stdout, v2.0 from
/Users/bklotz/ansible/lib/ansible/plugins/callback/default.pyc
2018-01-25 11:20:10,555 p=47423 u=bklotz |  PLAYBOOK: testing.yml
**************************************************************************************************
2018-01-25 11:20:10,556 p=47423 u=bklotz |  1 plays in testing.yml
2018-01-25 11:20:10,620 p=47423 u=bklotz |  PLAY [Set Anycast name servers]
****************************************************************************************
2018-01-25 11:20:10,673 p=47423 u=bklotz |  META: ran handlers
2018-01-25 11:20:10,679 p=47423 u=bklotz |  TASK [ios_system]
******************************************************************************************************
2018-01-25 11:20:10,679 p=47423 u=bklotz |  task path: /Users/bklotz/Box
Sync/Python/ansible-northwoods/testing.yml:7
2018-01-25 11:20:12,190 paramiko.transport starting thread (client mode):
0xa1a6650L
2018-01-25 11:20:12,191 paramiko.transport Local version/idstring:
SSH-2.0-paramiko_2.4.0
2018-01-25 11:20:12,194 paramiko.transport Remote version/idstring:
SSH-2.0-Cisco-1.25
2018-01-25 11:20:12,194 paramiko.transport Connected (version 2.0, client
Cisco-1.25)
2018-01-25 11:20:12,195 paramiko.transport kex
algos:[u'diffie-hellman-group-exchange-sha1',
u'diffie-hellman-group14-sha1', u'diffie-hellman-group1-sha1'] server
key:[u'ssh-rsa'] client encrypt:[u'aes128-ctr', u'aes192-ctr',
u'aes256-ctr', u'aes128-cbc', u'3des-cbc', u'aes192-cbc', u'aes256-cbc']
server encrypt:[u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'aes128-cbc',
u'3des-cbc', u'aes192-cbc', u'aes256-cbc'] client mac:[u'hmac-sha1',
u'hmac-sha1-96'] server mac:[u'hmac-sha1', u'hmac-sha1-96'] client
compress:[u'none'] server compress:[u'none'] client lang:[u''] server
lang:[u''] kex follows?False
2018-01-25 11:20:12,195 paramiko.transport Kex agreed:
diffie-hellman-group-exchange-sha1
2018-01-25 11:20:12,195 paramiko.transport HostKey agreed: ssh-rsa
2018-01-25 11:20:12,196 paramiko.transport Cipher agreed: aes128-ctr
2018-01-25 11:20:12,196 paramiko.transport MAC agreed: hmac-sha1
2018-01-25 11:20:12,196 paramiko.transport Compression agreed: none
2018-01-25 11:20:12,406 paramiko.transport Got server p (2048 bits)
2018-01-25 11:20:12,735 paramiko.transport kex engine KexGex specified
hash_algo <built-in function openssl_sha1>
2018-01-25 11:20:12,736 paramiko.transport Switch to new keys ...
2018-01-25 11:20:12,945 paramiko.transport userauth is OK
2018-01-25 11:20:12,945 paramiko.transport Auth banner:
********************************************************
* WARNING
* This system is owned by Nike, Inc. If you are not
* authorized to access this system, exit immediately.
* Unauthorized access to this system is forbidden by
* company policies, national, and international laws.
* Unauthorized users are subject to criminal and civil
* penalties as well as company initiated disciplinary
* proceedings.
********************************************************

2018-01-25 11:20:12,979 paramiko.transport Authentication (password)
successful!
2018-01-25 11:20:13,010 paramiko.transport [chan 0] Max packet in: 32768
bytes
2018-01-25 11:20:13,014 paramiko.transport [chan 0] Max packet out: 4096
bytes
2018-01-25 11:20:13,014 paramiko.transport Secsh channel 0 opened.
2018-01-25 11:20:13,022 paramiko.transport [chan 0] Sesch channel 0 request
ok
2018-01-25 11:20:13,027 paramiko.transport [chan 0] Sesch channel 0 request
ok
2018-01-25 11:20:33,539 p=47434 u=bklotz |  shutdown complete
2018-01-25 11:20:33,621 paramiko.transport EOF in transport thread
2018-01-25 11:20:34,179 p=47423 u=bklotz |  The full traceback is:
Traceback (most recent call last):
  File "/Users/bklotz/ansible/bin/ansible-connection", line 70, in start
    self.connection._connect()
  File
"/Users/bklotz/ansible/lib/ansible/plugins/connection/network_cli.py", line
323, in _connect
    self._terminal.on_become(passwd=auth_pass)
  File "/Users/bklotz/ansible/lib/ansible/plugins/terminal/ios.py", line
75, in on_become
    prompt = self._get_prompt()
  File "/Users/bklotz/ansible/lib/ansible/plugins/terminal/__init__.py",
line 74, in _get_prompt
    self._exec_cli_command(b'')
  File "/Users/bklotz/ansible/lib/ansible/plugins/terminal/__init__.py",
line 64, in _exec_cli_command
    return self._connection.exec_command(cmd)
  File
"/Users/bklotz/ansible/lib/ansible/plugins/connection/network_cli.py", line
245, in exec_command
    return self.send(command=cmd)
  File
"/Users/bklotz/ansible/lib/ansible/plugins/connection/network_cli.py", line
421, in send
    raise AnsibleConnectionFailure("timeout trying to send command: %s" %
command.strip())
AnsibleConnectionFailure: timeout trying to send command:

2018-01-25 11:20:34,185 p=47423 u=bklotz |  fatal: [NKNAWHQNWA01AX01]:
FAILED! => {
    "failed": true,
    "msg": "timeout trying to send command: "
}
2018-01-25 11:20:34,188 p=47423 u=bklotz |  to retry, use: --limit
@/Users/bklotz/Box Sync/Python/ansible-northwoods/testing.retry

2018-01-25 11:20:34,188 p=47423 u=bklotz |  PLAY RECAP
*************************************************************************************************************
2018-01-25 11:20:34,189 p=47423 u=bklotz |  NKNAWHQNWA01AX01           :
ok=0    changed=0    unreachable=0    failed=1


On Wed, Jan 24, 2018 at 9:06 PM Trishna Guha <notifications@github.com>
wrote:

> @brainclots <https://github.com/brainclots> Can you please test this on
> latest devel branch?
> There recently has been a PR #34723
> <https://github.com/ansible/ansible/pull/34723> merged which might makes
> this return a meaningful error message.
>
> To test against devel branch:
>
> git clone https://github.com/ansible/ansible.git
> source hacking/env-setup
>
> —
> You are receiving this because you were mentioned.
>
>
> Reply to this email directly, view it on GitHub
> <https://github.com/ansible/ansible/issues/33993#issuecomment-360362018>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AbFU9mzcpPbX4RBT-qnYmO6VdiiRZPwIks5tOAu4gaJpZM4RFrMW>
> .
>
-- 
"Have you tried turning it off and on again?"


Resolving patch:
diff --git a/lib/ansible/plugins/terminal/__init__.py b/lib/ansible/plugins/terminal/__init__.py
--- a/lib/ansible/plugins/terminal/__init__.py
+++ b/lib/ansible/plugins/terminal/__init__.py
@@ -69,11 +69,7 @@ def _get_prompt(self):
 
         :returns: A byte string of the prompt
         """
-        # do not send '\n' here, exec_cli_command sends '\r' already,
-        # doing so causes double prompts.
-        self._exec_cli_command(b'')
-
-        return self._connection._matched_prompt
+        return self._connection.get_prompt()
 
     def on_open_shell(self):
         """Called after the SSH session is established


Test patch: