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)]
U880D
  • 597
  • 7
  • 17
saurabh
  • 56
  • 2

1 Answers1

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

U880D
  • 597
  • 7
  • 17