Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible.netcommon.cli_command prompt does not match known host fingerprint response. #663

Open
Githopp opened this issue Aug 14, 2024 · 0 comments

Comments

@Githopp
Copy link

Githopp commented Aug 14, 2024

SUMMARY
ISSUE TYPE
  • Bug Report
COMPONENT NAME

ansible.netcommon.cli_command

ANSIBLE VERSION
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110]

COLLECTION VERSION
# /usr/lib/python3/dist-packages/ansible_collections
Collection        Version
----------------- -------
ansible.netcommon 1.5.0  

# /root/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
ansible.netcommon 7.0.0  

CONFIGURATION
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False

OS / ENVIRONMENT

Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye

target OS:
Aruba 6000
AOSCX

STEPS TO REPRODUCE
- name: AOS-CX Collector
  hosts: arubaos-cx
  gather_facts: no
  collections:
   - arubanetworks.aoscx
   
  vars:
    ansible_network_os: arubanetworks.aoscx.aoscx
    ansible_user: manager
    ansible_connection: network_cli 
    ansible_host_key_checking: false
    ansible_python_interpreter: /usr/bin/python3
    ansible_aoscx_validate_certs: false
    ansible_aoscx_use_proxy: false
    ansible_acx_no_proxy: true

  tasks:
    - name: "Show Config"
      aoscx_command:
        commands: ['show images']
     
      register: show_aoscx_output

    - debug:
        msg: "{{output.stdout_lines}}"

    - name: SSH on SFTP for confirmation
      ansible.netcommon.cli_command: 
        command: ssh [email protected]
        check_all: true
        prompt:
        - '.*'
        - Password
        answer:
        - yes\n
        - thepassword

EXPECTED RESULTS

The authenticity of host ... can't be established.
ED25519 key fingerprint is SHA256:jfwKE8.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])?

prompt should send 'yes'

I tried different combinations of prompt 'the authencity', 'connecting', it triggers timeout.

when I accept the host key via switch cli, the command produces expected result, eg password is send connection established

TASK [SSH on SFTP for confirmation] ****************************************************************************************************************************************************
ok: [192.168.1.16]

TASK [debug] ***************************************************************************************************************************************************************************
ok: [192.168.1.16] => {
"msg": [
"sftpuser@2::251's password: ",
"thepassword",
"thepassword",
"This service allows sftp connections only.",
"Connection to 2::251 closed."
]
}

ACTUAL RESULTS

fatal: [192.168.1.16]: FAILED! => {"changed": false, "msg": "command timeout triggered, timeout value is 30 secs.\nSee the timeout setting options in the Network Debug and Troubleshooting Guide."}


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant