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)]
According the given playbook
and the error message
there is a typo in
vars:
section as it should beFurther Documentaion
icx_command
module – Run arbitrary commands on remote Ruckus ICX 7000 series switchesRegarding 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.