ansible-collections / cisco.ios

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

There is an error message on NEC IX router using cli_command #372

Closed kazu-bueli closed 3 years ago

kazu-bueli commented 3 years ago
SUMMARY

There is an error message. It seems that the job's authority could not change to enable mode.

The target (inventory) is a NEC IX router.

Could you please tell me the reason. And teach me the way to resolve the problem.

ISSUE TYPE

Bug Report

COMPONENT NAME

network_cli

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: command test
   hosts: "{{ host_name }}"
   gather_facts: no
   become: yes

   vars:
     ansible_connection: network_cli
     ansible_network_os: ios

   tasks:
     - name: command test
       cli_command:
         command: show version
EXPECTED RESULTS

Executing all command and no error occurs.

ACTUAL RESULTS
{
    "msg": "unable to elevate privilege to enable mode, at prompt [b'\\nRouter(config)# '] with error: failed to elevate privilege to enable mode still at prompt [b'\\nRouter(config)# ']",
    "invocation": {
        "module_args": {
            "command": "show version",
            "newline": true,
            "sendonly": false,
            "check_all": false,
            "prompt": null,
            "answer": null
        }
    },
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/libexec/platform-python"
    },
    "_ansible_no_log": false,
    "changed": false
}
KB-perByte commented 3 years ago

Hi @kazu-bueli, The module supports prompts from Cisco devices. NEC IX being a different vendor we are not supporting the available prompts. Thanks.