dears,

Kindly help to solve this issue, i have the below error when run ad-hoc 
command "ios_ping "

[mohamedlocalhost proj]$  ansible -m ios_ping 192.168.1.101 -a 
"dest=192.168.1.101" 
SSH password: 
[WARNING]: ansible-pylibssh not installed, falling back to paramiko
192.168.1.101 | FAILED! => {
    "changed": false,
    "msg": "Failed to authenticate: Authentication failed: transport shut 
down or saw EOF"

i can use ping module normally please check attachment 1 

the ansible can ssh this device .101 , this device is eve-ng cisco L3 IOL 
.when i check the logs and make debug on it i found below 

*Dec 25 16:46:01.337: SSH2 0: MAC compared for #5 :ok
*Dec 25 16:46:01.337: SSH2 0: input: padlength 15 bytes
*Dec 25 16:46:01.337: SSH2 0: Using method = publickey
*Dec 25 16:46:01.337: SSH2 0: Received publickey algo = rsa-sha2-512
*Dec 25 16:46:01.337: SSH2 0: Unsupported public key algorithm rsa-sha2-512 
in SSH2_MSG_USERAUTH_REQUEST
*Dec 25 16:46:01.337: SSH0: password authentication failed for root


=======================================

[mohamedlocalhost proj]$  ansible -m ios_ping 192.168.1.101 -a 
"dest=192.168.1.101" -vvv
ansible [core 2.15.7]
  config file = /home/mohamed/RED_Hat_Course/proj/ansible.cfg
  configured module search path = 
['/home/mohamed/.ansible/plugins/modules', 
'/usr/share/ansible/plugins/modules']
  ansible python module location = 
/home/mohamed/.local/lib/python3.9/site-packages/ansible
  ansible collection location = 
/home/mohamed/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/mohamed/.local/bin/ansible
  python version = 3.9.18 (main, Sep 22 2023, 17:58:34) [GCC 8.5.0 20210514 
(Red Hat 8.5.0-20)] (/usr/bin/python3.9)
  jinja version = 3.1.2
  libyaml = True
Using /home/mohamed/RED_Hat_Course/proj/ansible.cfg as config file
SSH password: 
host_list declined parsing /home/mohamed/RED_Hat_Course/proj/cisco as it 
did not pass its verify_file() method
script declined parsing /home/mohamed/RED_Hat_Course/proj/cisco as it did 
not pass its verify_file() method
auto declined parsing /home/mohamed/RED_Hat_Course/proj/cisco as it did not 
pass its verify_file() method
Parsed /home/mohamed/RED_Hat_Course/proj/cisco inventory source with ini 
plugin
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
[WARNING]: ansible-pylibssh not installed, falling back to paramiko
redirecting (type: modules) ansible.builtin.ios_ping to cisco.ios.ios_ping
redirecting (type: action) ansible.builtin.ios to cisco.ios.ios
redirecting (type: action) ansible.builtin.ios to cisco.ios.ios
redirecting (type: modules) ansible.builtin.ios_ping to cisco.ios.ios_ping
The full traceback is:
  File 
"/home/mohamed/.local/lib/python3.9/site-packages/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/mohamed/.local/lib/python3.9/site-packages/ansible/module_utils/connection.py",
 
line 200, in __rpc__
    raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), 
code=code)
192.168.1.101 | FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "afi": "ip",
            "count": null,
            "dest": "192.168.1.101",
            "df_bit": false,
            "egress": null,
            "ingress": null,
            "source": null,
            "state": "present",
            "timeout": null,
            "vrf": null
        }
    },
    "msg": "Failed to authenticate: Authentication failed: transport shut 
down or saw EOF"


============================
inventory=cisco 
[all]
192.168.1.101
192.168.1.102
192.168.1.103

[usa]
192.168.1.101
192.168.1.102

[uk]
192.168.1.103


ansible.cfg

[defaults]
host_key_checking = False
inventory = cisco
ask_pass = true
gathering = explicit
interpreter_python = /usr/bin/python

[persistent_connection]
command_timeout = 200
connect_timeout = 200
connect_retry_timeout = 100


Group_var 
ansible_connection: ansible.netcommon.network_cli
ansible_network_os: cisco.ios.ios
ansible_user: root
ansible_password: admin
ansible_vrf: MGMT

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/01bc611c-c83d-4e7d-b50f-eaffdaa02e75n%40googlegroups.com.

Reply via email to