# Trying to get ICX modules to work

**URL:** <https://forum.ansible.com/t/trying-to-get-icx-modules-to-work/10037>\
**Category:** Get Help\
**Tags:** galaxy-ng\
**Created:** [October 8, 2024, 3:14pm UTC](https://forum.ansible.com/t/trying-to-get-icx-modules-to-work/10037 "2024-10-08T15:14:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_P](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/eric_p/32/5065_2.png) [@Eric\_P](https://forum.ansible.com/u/Eric_P)\
**Post date:** [October 8, 2024, 3:14pm UTC](https://forum.ansible.com/t/trying-to-get-icx-modules-to-work/10037/1 "2024-10-08T15:14:18Z")

</div>

Thank you in advance!  
I’m new to Ansible and am trying to use it to pull info and manage a couple hundred ICX switches. Ansible version I’m using is 2.16.11. I’m running older, but completely supported, firmware on my ICX switches 08.0.95p. I installed the ICX modules using “ansible-galaxy collection install commscope.icx”. These ICX modules I’ve installed state that they’ve been tested with 10.1, but on the main Github readme it shows as tested with 8.0.95. I’m not sure if the problem i’m having is an incompatibility between these modules and the version of ICX firmware I’m running or if I’m making an error myself.

I have successfully setup ssh key authentication. It gives an enabled prompt upon login. I’ve also successfully run a ping playbook returning pong for each switch.

## When I run my test playbook, the 1st automatic Gather Facts is successful, but when I run my play to gather facts, I get an error. Playbook File:

- hosts: switch1
  - name: Collectfacts  
commscope.icx.icx\_facts:  
gather\_subset: interfaces

Here is the output of the playbook command I’m running:

linux:$ ansible-playbook -vvv ~/gatherfacts.yaml  
ansible-playbook [core 2.16.11]  
config file = /etc/ansible/ansible.cfg  
configured module search path = [‘/home/folder/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/lib/python3/dist-packages/ansible  
ansible collection location = /home/folder/.ansible/collections:/usr/share/ansible/collections  
executable location = /usr/bin/ansible-playbook  
python version = 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0] (/usr/bin/python3)  
jinja version = 3.0.3  
libyaml = True  
Using /etc/ansible/ansible.cfg as config file  
host\_list declined parsing /etc/ansible/hosts as it did not pass its verify\_file() method  
script declined parsing /etc/ansible/hosts as it did not pass its verify\_file() method  
auto declined parsing /etc/ansible/hosts as it did not pass its verify\_file() method  
Parsed /etc/ansible/hosts inventory source with ini plugin  
Skipping callback ‘default’, as we already have a stdout callback.  
Skipping callback ‘minimal’, as we already have a stdout callback.  
Skipping callback ‘oneline’, as we already have a stdout callback.

PLAYBOOK: gatherfacts.yaml \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
1 plays in /home/folder/gatherfacts.yaml

PLAY [switch1] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /home/folder/gatherfacts.yaml:2  
redirecting (type: connection) ansible.builtin.network\_cli to ansible.netcommon.network\_cli  
redirecting (type: terminal) ansible.builtin.icx to community.network.icx  
redirecting (type: cliconf) ansible.builtin.icx to community.network.icx  
[WARNING]: ansible-pylibssh not installed, falling back to paramiko  
 ESTABLISH LOCAL CONNECTION FOR USER: folder  
 EXEC /bin/sh -c ‘( umask 77 && mkdir -p “`echo /home/folder/.ansible/tmp/ansible-local-39134nnyh3bql`”&& mkdir “`echo /home/folder/.ansible/tmp/ansible-local-39134nnyh3bql/ansible-tmp-1728399080.4855485-39137-246645022622956`” && echo ansible-tmp-1728399080.4855485-39137-246645022622956=“`echo /home/folder/.ansible/tmp/ansible-local-39134nnyh3bql/ansible-tmp-1728399080.4855485-39137-246645022622956`” ) && sleep 0’  
Using module file /usr/lib/python3/dist-packages/ansible/modules/setup.py  
 PUT /home/folder/.ansible/tmp/ansible-local-39134nnyh3bql/tmpe0kt2hog TO /home/folder/.ansible/tmp/ansible-local-39134nnyh3bql/ansible-tmp-1728399080.4855485-39137-246645022622956/AnsiballZ\_setup.py  
 EXEC /bin/sh -c ‘chmod u+x /home/folder/.ansible/tmp/ansible-local-39134nnyh3bql/ansible-tmp-1728399080.4855485-39137-246645022622956/ /home/folder/.ansible/tmp/ansible-local-39134nnyh3bql/ansible-tmp-1728399080.4855485-39137-246645022622956/AnsiballZ\_setup.py && sleep 0’  
 EXEC /bin/sh -c ‘/usr/bin/python3 /home/folder/.ansible/tmp/ansible-local-39134nnyh3bql/ansible-tmp-1728399080.4855485-39137-246645022622956/AnsiballZ\_setup.py && sleep 0’  
 EXEC /bin/sh -c ‘rm -f -r /home/folder/.ansible/tmp/ansible-local-39134nnyh3bql/ansible-tmp-1728399080.4855485-39137-246645022622956/ \> /dev/null 2\>&1 && sleep 0’  
ok: [switch1]

TASK [Collectfacts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /home/folder/gatherfacts.yaml:16  
redirecting (type: connection) ansible.builtin.network\_cli to ansible.netcommon.network\_cli  
redirecting (type: terminal) ansible.builtin.icx to community.network.icx  
redirecting (type: cliconf) ansible.builtin.icx to community.network.icx  
 ESTABLISH LOCAL CONNECTION FOR USER: folder  
 EXEC /bin/sh -c ‘( umask 77 && mkdir -p “`echo /home/folder/.ansible/tmp/ansible-local-39134nnyh3bql`”&& mkdir “`echo /home/folder/.ansible/tmp/ansible-local-39134nnyh3bql/ansible-tmp-1728399081.4583206-39214-177324427436000`” && echo ansible-tmp-1728399081.4583206-39214-177324427436000=“`echo /home/folder/.ansible/tmp/ansible-local-39134nnyh3bql/ansible-tmp-1728399081.4583206-39214-177324427436000`” ) && sleep 0’  
Using module file /home/folder/.ansible/collections/ansible\_collections/commscope/icx/plugins/modules/icx\_facts.py  
 PUT /home/folder/.ansible/tmp/ansible-local-39134nnyh3bql/tmpzl0ffkxp TO /home/folder/.ansible/tmp/ansible-local-39134nnyh3bql/ansible-tmp-1728399081.4583206-39214-177324427436000/AnsiballZ\_icx\_facts.py  
 EXEC /bin/sh -c ‘chmod u+x /home/folder/.ansible/tmp/ansible-local-39134nnyh3bql/ansible-tmp-1728399081.4583206-39214-177324427436000/ /home/folder/.ansible/tmp/ansible-local-39134nnyh3bql/ansible-tmp-1728399081.4583206-39214-177324427436000/AnsiballZ\_icx\_facts.py && sleep 0’  
 EXEC /bin/sh -c ‘/usr/bin/python3 /home/folder/.ansible/tmp/ansible-local-39134nnyh3bql/ansible-tmp-1728399081.4583206-39214-177324427436000/AnsiballZ\_icx\_facts.py && sleep 0’  
 EXEC /bin/sh -c ‘rm -f -r /home/folder/.ansible/tmp/ansible-local-39134nnyh3bql/ansible-tmp-1728399081.4583206-39214-177324427436000/ \> /dev/null 2\>&1 && sleep 0’  
The full traceback is:  
Traceback (most recent call last):  
File “/home/folder/.ansible/tmp/ansible-local-39134nnyh3bql/ansible-tmp-1728399081.4583206-39214-177324427436000/AnsiballZ\_icx\_facts.py”, line 107, in   
\_ansiballz\_main()  
File “/home/folder/.ansible/tmp/ansible-local-39134nnyh3bql/ansible-tmp-1728399081.4583206-39214-177324427436000/AnsiballZ\_icx\_facts.py”, line 99, in \_ansiballz\_main  
invoke\_module(zipped\_mod, temp\_path, ANSIBALLZ\_PARAMS)  
File “/home/folder/.ansible/tmp/ansible-local-39134nnyh3bql/ansible-tmp-1728399081.4583206-39214-177324427436000/AnsiballZ\_icx\_facts.py”, line 47, in invoke\_module  
runpy.run\_module(mod\_name=‘ansible\_collections.commscope.icx.plugins.modules.icx\_facts’, init\_globals=dict(\_module\_fqn=‘ansible\_collections.commscope.icx.plugins.modules.icx\_facts’, \_modlib\_path=modlib\_path),  
File “/usr/lib/python3.10/runpy.py”, line 224, in run\_module  
return \_run\_module\_code(code, init\_globals, run\_name, mod\_spec)  
File “/usr/lib/python3.10/runpy.py”, line 96, in \_run\_module\_code  
\_run\_code(code, mod\_globals, init\_globals,  
File “/usr/lib/python3.10/runpy.py”, line 86, in \_run\_code  
exec(code, run\_globals)  
File “/tmp/ansible\_commscope.icx.icx\_facts\_payload\_wdf539\_g/ansible\_commscope.icx.icx\_facts\_payload.zip/ansible\_collections/commscope/icx/plugins/modules/icx\_facts.py”, line 596, in   
File “/tmp/ansible\_commscope.icx.icx\_facts\_payload\_wdf539\_g/ansible\_commscope.icx.icx\_facts\_payload.zip/ansible\_collections/commscope/icx/plugins/modules/icx\_facts.py”, line 584, in main  
File “/tmp/ansible\_commscope.icx.icx\_facts\_payload\_wdf539\_g/ansible\_commscope.icx.icx\_facts\_payload.zip/ansible\_collections/commscope/icx/plugins/modules/icx\_facts.py”, line 167, in populate  
TypeError: ‘NoneType’ object is not subscriptable  
fatal: [switch1]: FAILED! =\> {  
“changed”: false,  
“module\_stderr”: “Traceback (most recent call last):\n File "/home/folder/.ansible/tmp/ansible-local-39134nnyh3bql/ansible-tmp-1728399081.4583206-39214-177324427436000/AnsiballZ\_icx\_facts.py", line 107, in \n \_ansiballz\_main()\n File "/home/folder/.ansible/tmp/ansible-local-39134nnyh3bql/ansible-tmp-1728399081.4583206-39214-177324427436000/AnsiballZ\_icx\_facts.py", line 99, in \_ansiballz\_main\n invoke\_module(zipped\_mod, temp\_path, ANSIBALLZ\_PARAMS)\n File "/home/folder/.ansible/tmp/ansible-local-39134nnyh3bql/ansible-tmp-1728399081.4583206-39214-177324427436000/AnsiballZ\_icx\_facts.py", line 47, in invoke\_module\n runpy.run\_module(mod\_name=‘ansible\_collections.commscope.icx.plugins.modules.icx\_facts’, init\_globals=dict(\_module\_fqn=‘ansible\_collections.commscope.icx.plugins.modules.icx\_facts’, \_modlib\_path=modlib\_path),\n File "/usr/lib/python3.10/runpy.py", line 224, in run\_module\n return \_run\_module\_code(code, init\_globals, run\_name, mod\_spec)\n File "/usr/lib/python3.10/runpy.py", line 96, in \_run\_module\_code\n \_run\_code(code, mod\_globals, init\_globals,\n File "/usr/lib/python3.10/runpy.py", line 86, in \_run\_code\n exec(code, run\_globals)\n File "/tmp/ansible\_commscope.icx.icx\_facts\_payload\_wdf539\_g/ansible\_commscope.icx.icx\_facts\_payload.zip/ansible\_collections/commscope/icx/plugins/modules/icx\_facts.py", line 596, in \n File "/tmp/ansible\_commscope.icx.icx\_facts\_payload\_wdf539\_g/ansible\_commscope.icx.icx\_facts\_payload.zip/ansible\_collections/commscope/icx/plugins/modules/icx\_facts.py", line 584, in main\n File "/tmp/ansible\_commscope.icx.icx\_facts\_payload\_wdf539\_g/ansible\_commscope.icx.icx\_facts\_payload.zip/ansible\_collections/commscope/icx/plugins/modules/icx\_facts.py", line 167, in populate\nTypeError: ‘NoneType’ object is not subscriptable\n”,  
“module\_stdout”: “”,  
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,  
“rc”: 1  
}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
switch1 : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

---

<div class="post-metadata">

**Author:** ![Eric\_P](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/eric_p/32/5065_2.png) [@Eric\_P](https://forum.ansible.com/u/Eric_P)\
**Post date:** [October 9, 2024, 1:43pm UTC](https://forum.ansible.com/t/trying-to-get-icx-modules-to-work/10037/2 "2024-10-09T13:43:05Z")

</div>

I ran “pip install --user ansible-pylibssh” and it resolved the issue.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [November 8, 2024, 1:43pm UTC](https://forum.ansible.com/t/trying-to-get-icx-modules-to-work/10037/3 "2024-11-08T13:43:44Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
