【问题标题】:Ansible` ios_command `Error reading SSH protocol banner[Errno 104] Connection reset by peerAnsible`ios_command`读取SSH协议横幅时出错[Errno 104]对等方重置连接
【发布时间】:2022-08-07 04:36:59
【问题描述】:

我有这个命令,它基本上只是从设备中获取数据。

- name: Get data
  tags: get_facts
  ios_command:
    commands:
      - show version
  register: ruijie_sh_interfaces
  vars:
    ansible_command_timeout: 90
    ansible_connection: network_cli
    ansible_network_os: ios

但是在 AWX 塔上运行这个剧本时它给了我这个错误。

    \"msg\": \"Error reading SSH protocol banner[Errno 104] Connection reset by peer\"

我知道ssh user@ip 无法访问此设备,它输出:

Unable to negotiate with <IP> port 22: no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1

但是可以使用ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 user@ip

我想知道如何在 ansible 中使用network_cli 连接类型来实现-oKexAlgorithms=+diffie-hellman-group1-sha1

标签: ansible ansible-awx cisco-ios


【解决方案1】:

您能否将密钥 ansible_ssh_common_args 添加到 AWX 中的设备清单并再次检查?

- name: Get data
  tags: get_facts
  ios_command:
    commands:
      - show version
  register: ruijie_sh_interfaces
  vars:
    ansible_command_timeout: 90
    ansible_connection: network_cli
    ansible_network_os: ios
    ansible_ssh_common_args: '-o KexAlgorithms=+diffie-hellman-group1-sha1 -o HostKeyAlgorithms=+ssh-rsa -o Ciphers=+aes256-cbc'

参考。 https://github.com/ansible/awx/issues/12578

【讨论】:

    猜你喜欢
    • 2022-12-10
    • 2014-10-25
    • 1970-01-01
    • 2011-11-04
    • 2017-10-05
    • 1970-01-01
    • 2020-10-08
    • 2016-03-03
    • 2016-10-10
    相关资源
    最近更新 更多