Trying to get ICX modules to work

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

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