ansible-collections / cisco.ios

Ansible Network Collection for Cisco IOS
GNU General Public License v3.0
293 stars 171 forks source link

Authentication Error to run ansible-playbook #978

Closed bacchus21 closed 10 months ago

bacchus21 commented 11 months ago
SUMMARY

Hello, All

I’m trying to run one of my playbooks toward Cisco IOS devices. Manual login to the device with the user password ssh -l user1 OOOO-XXX-SW03 is working fine. But not sure why the same password is not getting through when I run playbook.

[root@ansible002 ansible]# ansible-playbook plb-password.yml -i inv_for_testing.yml -u user1 -k --check
SSH password:

PLAY [plb-password.yml] **************************************************

TASK [Check enable secret is configured] ***********************************************************
fatal: [OOOO-XXX-SW03]: FAILED! => {"changed": false, "msg": "Failed to authenticate: Authentication failed: transport shut down or saw EOF"}
...ignoring

PLAY RECAP *****************************************************************************************
OOOO-XXX-SW03 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=1

[root@ansible002 ansible]#

Does anyone have clue or similar experience? Any comments/feedback are welcomed. Thank you in advance.

Regards

ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
$ ansible --version
ansible [core 2.15.6]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/lsavj58sl/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/lsavj58sl/.local/lib/python3.9/site-packages/ansible
  ansible collection location = /home/lsavj58sl/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/lsavj58sl/.local/bin/ansible
  python version = 3.9.18 (main, Sep  7 2023, 00:00:00) [GCC 11.4.1 20230605 (Red Hat 11.4.1-2)] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
Collection             Version
---------------------- -------
ansible.netcommon      5.3.0
ansible.utils          2.11.0
cisco.ios              5.2.0
cisco.iosxr            6.1.0
cisco.nxos             5.2.1
community.network      5.0.2
paloaltonetworks.panos 2.17.8
CONFIGURATION
$ ansible-config dump --only-changed -t all
CONFIG_FILE() = /etc/ansible/ansible.cfg
DEFAULT_FORKS(/etc/ansible/ansible.cfg) = 10
DEFAULT_TIMEOUT(/etc/ansible/ansible.cfg) = 5
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False
INVENTORY_ENABLED(/etc/ansible/ansible.cfg) = ['yaml']
PARAMIKO_LOOK_FOR_KEYS(/etc/ansible/ansible.cfg) = False

CONNECTION:
==========

paramiko_ssh:
____________
host_key_checking(/etc/ansible/ansible.cfg) = False
look_for_keys(/etc/ansible/ansible.cfg) = False
timeout(/etc/ansible/ansible.cfg) = 5

ssh:
___
host_key_checking(/etc/ansible/ansible.cfg) = False
timeout(/etc/ansible/ansible.cfg) = 5
OS / ENVIRONMENT

RHEL9

STEPS TO REPRODUCE

Described above.

EXPECTED RESULTS

TASK [Check enable secret is configured] *** SUCCESS

ACTUAL RESULTS
TASK [Check enable secret is configured] ***********************************************************
fatal: [OOOO-XXX-SW03]: FAILED! => {"changed": false, "msg": "Failed to authenticate: Authentication failed: transport shut down or saw EOF"}
...ignoring
roverflow commented 11 months ago

@bacchus21 Hey, Thanks for reporting the issue, I tested the above issue and seems to work fine for me, could you share more details like how your inventory and ansible.cfg looks like, could you also share the playbook you ran.

Edit; could you add a connection timeout and command timeout in your ansible.cfg and tell me if that works, After testing at my end everything seems to be working fine.

[persistent_connection]
connect_timeout = 200
command_timeout = 200
mohamedmostafaabdelghany commented 10 months ago

hello , any one can help , i face the same exact issue

roverflow commented 10 months ago

@mohamedmostafaabdelghany, I've responded to your post on the Ansible forum regarding your issue. Regarding the matter with @bacchus21, after numerous tests, I couldn't replicate the issue, so I'll be closing this issue. Feel free to contact me on the Ansible community forum if you need further assistance.

mohamedmostafaabdelghany commented 10 months ago

Dears, Please don’t close the case i will try the solution and feedback tomorrow 

Sent from Yahoo Mail for iPhone

On Friday, December 29, 2023, 11:55 AM, Vinay M @.***> wrote:

Closed #978 as completed.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

roverflow commented 10 months ago

Dears, Please don’t close the case i will try the solution and feedback tomorrow 

Sent from Yahoo Mail for iPhone

On Friday, December 29, 2023, 11:55 AM, Vinay M @.***> wrote:

Closed #978 as completed.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

Hey, this is not an actual issue with the collection, hence i have closed it, i will still reply to your concern if you are stuck.

asceylan commented 6 months ago

For those who have been still experiencing this problem, changing ansible ssh method from paramiko to ansible-pylibssh fixed the problem for me

mmatease1 commented 5 months ago

dfg

changing ansible ssh method from paramiko to ansible-pylibssh fixed the problem for me

the same for me ...thank you so much for the hint !!!!!!