1

I've to perform some network automation in my infra using Ansible.

When I'm trying to use Ansible module for ICX switches it seems to be misbehaving.

Playbook I used

- name: ICX switch testing
  hosts: test-switch
  gather_facts: no

  vars:
    ansible_user: username
    ansible_password: password
    ansible_connection=ansible.netcommon.network_cli
    ansible_network_os=icx

  tasks:

    - name: show version
      icx_command:
        commands:
          - show version

for this I'm getting below error

FAILED! => {"changed": false, "msg": "skip\r\nInvalid input -> skip\r\nType ? for a list\r\nSSH@ICX7250-24P Switch>"}

when I use enable mode using Ansible_become then it gives below error

FAILED! => {"changed": false, "msg": "unable to elevate privilege to enable mode, at prompt [None] with error: timeout value 60 seconds reached while trying to send command: b'enable'"}

I'm not sure why command enable changed to b'enable. Seems some issue with module

ansible version

ansible 2.9.9
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.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, Sep 26 2019, 11:57:09) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
0

2 Answers 2

0

According the given playbook

  vars:
    ansible_user: username
    ansible_password: password
    ansible_connection=ansible.netcommon.network_cli
    ansible_network_os=icx

and the error message

Invalid input -> skip\r\nType ? for a list

there is a typo in vars: section as it should be

  vars:
    ansible_user: username
    ansible_password: password
    ansible_connection: ansible.netcommon.network_cli
    ansible_network_os: icx

Further Documentaion

0

Regarding this specific error:

Invalid input -> skip\r\nType ? for a list

You may have to modify the actual icx_config.py module.

On Macs, for example, it's located here:

/usr/local/Cellar/ansible/6.4.0/libexec/lib/python3.10/site-packages/ansible_collections/community/network/plugins/modules/network/icx/icx_config.py

The line you must modify is, potentially, 364:

run_commands(module, 'skip')

Comment it out and try again.

#run_commands(module, 'skip')

It took me many days to sort this out after googling with no avail, so maybe it helps someone in the future.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .