Skip to content

Help Needed: Authentication Failure Using cisco.ios.ios_command Module #1206

@romio28

Description

@romio28

Hello,

I'm reaching out to ask for assistance with an issue I'm encountering while using the cisco.ios.ios_command module from the cisco.ios Ansible collection.

When attempting to run a simple command such as show version on a Cisco IOS device, the task fails with the following error:

<192.168.34.88> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
<192.168.34.88> ANSIBLE_NETWORK_IMPORT_MODULES: found cisco.ios.ios_command  at /home/user1/.ansible/collections/ansible_collections/cisco/ios/plugins/modules/ios_command.py
<192.168.34.88> ANSIBLE_NETWORK_IMPORT_MODULES: running cisco.ios.ios_command
<192.168.34.88> ANSIBLE_NETWORK_IMPORT_MODULES: complete
The full traceback is:
  File "/home/user1/.ansible/collections/ansible_collections/cisco/ios/plugins/module_utils/network/ios/ios.py", line 60, in get_capabilities
    capabilities = Connection(module._socket_path).get_capabilities()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user1/.local/lib/python3.12/site-packages/ansible/module_utils/connection.py", line 183, in __rpc__
    raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), code=code)
fatal: [PER_OOB_HSM_01]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "commands": [
                "show version"
            ],
            "interval": 1,
            "match": "all",
            "retries": 9,
            "wait_for": null
        }
    },
    "msg": "Failed to authenticate: Authentication failed."
}

ansible --version

ansible [core 2.18.6]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/user1/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/user1/.local/lib/python3.12/site-packages/ansible
  ansible collection location = /home/user1/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.12.3 (main, Feb  4 2025, 14:48:35) [GCC 13.3.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

Collection Version
cisco.ios 10.1.0

I'm using the following configuration:

  • ansible_connection: network_cli
  • ansible_network_os: cisco.ios.ios
  • Valid SSH credentials that work manually

I’ve verified that the device is reachable and that the credentials work over SSH manually.

Any insights or suggestions would be greatly appreciated. Please let me know if you need any more details or configuration snippets.

Best regards,

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions