ansible-collections / ansible.netcommon

Ansible Network Collection for Common Code
GNU General Public License v3.0
143 stars 103 forks source link

There is an error message on NEC IX router using telnet #315

Open ishii-h opened 3 years ago

ishii-h commented 3 years ago
SUMMARY

I want to make a telnet connection to the NEC IX router and execute the command, but an error is returned immediately. The prompt to be set, the user name, and the password match, but I would like advice including how to write a playbook.

ISSUE TYPE
COMPONENT NAME

telnet

ANSIBLE VERSION
-sh-4.2$ ansible --version
ansible 2.10.5
config file = None
configured module search path = ['/home/kuemura/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
-sh-4.2$
COLLECTION VERSION
# /usr/local/lib/python3.6/site-packages/ansible_collections
Collection Version
------------------------- -------
amazon.aws 1.3.0
ansible.netcommon 1.4.1
ansible.posix 1.1.1
ansible.windows 1.3.0
arista.eos 1.2.0
awx.awx 14.1.0
azure.azcollection 1.3.1
check_point.mgmt 1.0.6
chocolatey.chocolatey 1.0.2
cisco.aci 1.1.1
cisco.asa 1.0.4
cisco.intersight 1.0.10
cisco.ios 1.2.1
cisco.iosxr 1.2.0
cisco.meraki 2.1.3
cisco.mso 1.1.0
cisco.nso 1.0.2
cisco.nxos 1.3.1
cisco.ucs 1.6.0
cloudscale_ch.cloud 1.3.1
community.aws 1.3.0
community.azure 1.0.0
community.crypto 1.4.0
community.digitalocean 1.0.0
community.docker 1.2.0
community.fortios 1.0.0
community.general 1.3.5
community.google 1.0.0
community.grafana 1.1.0
community.hashi_vault 1.0.0
community.hrobot 1.1.0
community.kubernetes 1.1.1
community.kubevirt 1.0.0
community.libvirt 1.0.0
community.mongodb 1.1.2
community.mysql 1.2.0
community.network 1.3.1
community.okd 1.0.1
community.postgresql 1.1.0
community.proxysql 1.0.0
community.rabbitmq 1.0.1
community.routeros 1.1.0
community.skydive 1.0.0
community.vmware 1.6.0
community.windows 1.2.0
community.zabbix 1.2.0
containers.podman 1.4.1
cyberark.conjur 1.1.0
cyberark.pas 1.0.5
dellemc.os10 1.0.2
dellemc.os6 1.0.6
dellemc.os9 1.0.3
f5networks.f5_modules 1.7.1
fortinet.fortimanager 1.0.5
fortinet.fortios 1.1.8
frr.frr 1.0.3
gluster.gluster 1.0.1
google.cloud 1.0.1
hetzner.hcloud 1.2.1
ibm.qradar 1.0.3
infinidat.infinibox 1.2.4
junipernetworks.junos 1.2.1
mellanox.onyx 1.0.0
netapp.aws 20.9.0
netapp.elementsw 20.11.0
netapp.ontap 20.12.0
netapp_eseries.santricity 1.1.0
netbox.netbox 1.2.1
ngine_io.cloudstack 1.1.0
ngine_io.exoscale 1.0.0
ngine_io.vultr 1.0.0
openstack.cloud 1.2.1
openvswitch.openvswitch 1.1.0
ovirt.ovirt 1.2.4
purestorage.flasharray 1.5.1
purestorage.flashblade 1.4.0
servicenow.servicenow 1.0.3
splunk.es 1.0.2
theforeman.foreman 1.5.1
vyos.vyos 1.1.0
wti.remote 1.0.1
CONFIGURATION
-sh-4.2$ ansible-config dump --only-changed
-sh-4.2$
OS / ENVIRONMENT

-sh-4.2$ cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core) -sh-4.2$ -sh-4.2$ -sh-4.2$

STEPS TO REPRODUCE
---
- name: telnet connect
  hosts: all
  gather_facts: no
  connection: local

  tasks:
    - name: telnet_connect
      telnet:
        user: username
        password: password
        login_prompt: "login"
        password_prompt: "Password"
        prompts:
          - "[$|>|#]"
        command:
          - show version
EXPECTED RESULTS

Executing show version command and no error occurs.

ACTUAL RESULTS
fatal: [Router]: FAILED! => {"changed": true, "msg": "Telnet action failed: telnet connection closed", "output": []}
kishankm1998 commented 2 years ago

Hi, got any update on this, i am stuck on something similar.