0

I am currently running ansible 2.7 and I have the following playbook

info.yaml
---
- hosts: routers
  gather_facts: true
  tasks:
    - name: show run
      ios_command:
        commands:
          - show running-config
      register: config

I have the following inventory file:

[local]
127.0.0.1 ansible_connection=local

[routers]
LAB-RTR-1
LAB-RTR-2

[routers:vars]
ansible_ssh_user= {{ cisco_user }}
ansible_ssh_pass= {{ cisco_pass }}
ansible_network_os=ios
ansible_connection=network_cli
ansible_become = yes
ansible_become_method = enable
anisble_become_pass = {{ auth_pass }}

Have the following in the vault

cisco_user: “admin”
cisco_pass: “password123”
auth_pass: “password123”

When i try to run this via cli like this:

ansible-playbook info.yaml --ask-vault-pass -vvv

I keep getting the following errors for some reason, and i can’t figure this out. I’ve been going crazy on this for the last few hours

The full traceback is:
Traceback (most recent call last):
  File "/usr/bin/ansible-connection", line 106, in start
    self.connection._connect()
  File "/usr/lib/python2.7/site-packages/ansible/plugins/connection/network_cli.py", line 341, in _connect
    self._terminal.on_become(passwd=auth_pass)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/terminal/ios.py", line 78, in on_become
    raise AnsibleConnectionFailure('unable to elevate privilege to enable mode, at prompt [%s] with error: %s' % (prompt, e.message))
AnsibleConnectionFailure: unable to elevate privilege to enable mode, at prompt [None] with error: timeout value 10 seconds reached while trying to send command: enable

fatal: [LAB-RTR-1]: FAILED! => {
    "msg": "unable to elevate privilege to enable mode, at prompt [None] with error: timeout value 10 seconds reached while trying to send command: enable"
}
Mr39
  • 51
  • 1
  • 10

1 Answers1

0

Haven't used ansible in a while (but the above looks ok to me), and never with cisco, but I found an open issue that looks very similar to yours which you may want to keep an eye on:

https://github.com/ansible/ansible/issues/51436

hhami
  • 176
  • 10
  • Yes thank you, i have been watching that, but nothing has been solved yet. I would think this would kind of be a priority since everyone who uses ansible connects to some type of cisco devices – Mr39 Mar 08 '19 at 21:06