Developer

 View Only
last person joined: 2 days ago 

Expand all | Collapse all

Ansible aoscx_poe module issues

This thread has been viewed 11 times
  • 1.  Ansible aoscx_poe module issues

    Posted 26 days ago

    Hello,

    Is there anyone aware of issues with the aoscx_poe Ansible module in version 4.3.2 or 4.4.0 (upgraded but got same problem)? Trying to implement the module, but I get constant callbacks.

    The Ansible config is very basic:

    - name: Set PoE for 1/1/3
      tags: interfaces, if-1/1/3
      aoscx_poe:
        interface: 1/1/3
        enable: true

    The pyaoscx Python modules are installed and up to date according to the requirements.txt on version 2.6.0.

    The full traceback is:

    <192.168.255.50> ESTABLISH LOCAL CONNECTION FOR USER: kevin
    <192.168.255.50> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/kevin/.ansible/tmp/ansible-local-24763wuhb925c `"&& mkdir "` echo /home/kevin/.ansible/tmp/ansible-local-24763wuhb925c/ansible-tmp-1726735256.7504492-24887-201900349104035 `" && echo ansible-tmp-1726735256.7504492-24887-201900349104035="` echo /home/kevin/.ansible/tmp/ansible-local-24763wuhb925c/ansible-tmp-1726735256.7504492-24887-201900349104035 `" ) && sleep 0'
    Using module file /home/kevin/.ansible/collections/ansible_collections/arubanetworks/aoscx/plugins/modules/aoscx_poe.py
    <192.168.255.50> PUT /home/kevin/.ansible/tmp/ansible-local-24763wuhb925c/tmpvh9rvja9 TO /home/kevin/.ansible/tmp/ansible-local-24763wuhb925c/ansible-tmp-1726735256.7504492-24887-201900349104035/AnsiballZ_aoscx_poe.py
    <192.168.255.50> EXEC /bin/sh -c 'chmod u+x /home/kevin/.ansible/tmp/ansible-local-24763wuhb925c/ansible-tmp-1726735256.7504492-24887-201900349104035/ /home/kevin/.ansible/tmp/ansible-local-24763wuhb925c/ansible-tmp-1726735256.7504492-24887-201900349104035/AnsiballZ_aoscx_poe.py && sleep 0'
    <192.168.255.50> EXEC /bin/sh -c '/usr/bin/python3 /home/kevin/.ansible/tmp/ansible-local-24763wuhb925c/ansible-tmp-1726735256.7504492-24887-201900349104035/AnsiballZ_aoscx_poe.py && sleep 0'
    <192.168.255.50> EXEC /bin/sh -c 'rm -f -r /home/kevin/.ansible/tmp/ansible-local-24763wuhb925c/ansible-tmp-1726735256.7504492-24887-201900349104035/ > /dev/null 2>&1 && sleep 0'
    The full traceback is:
    Traceback (most recent call last):
      File "/home/kevin/.ansible/tmp/ansible-local-24763wuhb925c/ansible-tmp-1726735256.7504492-24887-201900349104035/AnsiballZ_aoscx_poe.py", line 107, in <module>
        _ansiballz_main()
      File "/home/kevin/.ansible/tmp/ansible-local-24763wuhb925c/ansible-tmp-1726735256.7504492-24887-201900349104035/AnsiballZ_aoscx_poe.py", line 99, in _ansiballz_main
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
      File "/home/kevin/.ansible/tmp/ansible-local-24763wuhb925c/ansible-tmp-1726735256.7504492-24887-201900349104035/AnsiballZ_aoscx_poe.py", line 47, in invoke_module
        runpy.run_module(mod_name='ansible_collections.arubanetworks.aoscx.plugins.modules.aoscx_poe', init_globals=dict(_module_fqn='ansible_collections.arubanetworks.aoscx.plugins.modules.aoscx_poe', _modlib_path=modlib_path),
      File "<frozen runpy>", line 226, in run_module
      File "<frozen runpy>", line 98, in _run_module_code
      File "<frozen runpy>", line 88, in _run_code
      File "/tmp/ansible_aoscx_poe_payload_nbafys_h/ansible_aoscx_poe_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/modules/aoscx_poe.py", line 328, in <module>
      File "/tmp/ansible_aoscx_poe_payload_nbafys_h/ansible_aoscx_poe_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/modules/aoscx_poe.py", line 221, in main
      File "/usr/local/lib/python3.12/dist-packages/pyaoscx/pyaoscx_factory.py", line 1295, in poe_interface
        poe_interface_obj.get()
      File "/usr/local/lib/python3.12/dist-packages/pyaoscx/pyaoscx_module.py", line 40, in ensure_connected
        return fnct(self, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.12/dist-packages/pyaoscx/poe_interface.py", line 69, in get
        self._get_and_copy_data(depth, selector, self.indices)
      File "/usr/local/lib/python3.12/dist-packages/pyaoscx/pyaoscx_module.py", line 183, in _get_and_copy_data
        data = self._get_data(depth, selector)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.12/dist-packages/pyaoscx/pyaoscx_module.py", line 225, in _get_data
        raise GenericOperationError(response.text, response.status_code)
    pyaoscx.exceptions.generic_op_error.GenericOperationError: 'GENERIC OPERATION ERROR: \n: Code: 404'
    fatal: [swsa1]: FAILED! => {
        "changed": false,
        "module_stderr": "Traceback (most recent call last):\n  File \"/home/kevin/.ansible/tmp/ansible-local-24763wuhb925c/ansible-tmp-1726735256.7504492-24887-201900349104035/AnsiballZ_aoscx_poe.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/home/kevin/.ansible/tmp/ansible-local-24763wuhb925c/ansible-tmp-1726735256.7504492-24887-201900349104035/AnsiballZ_aoscx_poe.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/kevin/.ansible/tmp/ansible-local-24763wuhb925c/ansible-tmp-1726735256.7504492-24887-201900349104035/AnsiballZ_aoscx_poe.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.arubanetworks.aoscx.plugins.modules.aoscx_poe', init_globals=dict(_module_fqn='ansible_collections.arubanetworks.aoscx.plugins.modules.aoscx_poe', _modlib_path=modlib_path),\n  File \"<frozen runpy>\", line 226, in run_module\n  File \"<frozen runpy>\", line 98, in _run_module_code\n  File \"<frozen runpy>\", line 88, in _run_code\n  File \"/tmp/ansible_aoscx_poe_payload_nbafys_h/ansible_aoscx_poe_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/modules/aoscx_poe.py\", line 328, in <module>\n  File \"/tmp/ansible_aoscx_poe_payload_nbafys_h/ansible_aoscx_poe_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/modules/aoscx_poe.py\", line 221, in main\n  File \"/usr/local/lib/python3.12/dist-packages/pyaoscx/pyaoscx_factory.py\", line 1295, in poe_interface\n    poe_interface_obj.get()\n  File \"/usr/local/lib/python3.12/dist-packages/pyaoscx/pyaoscx_module.py\", line 40, in ensure_connected\n    return fnct(self, *args, **kwargs)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.12/dist-packages/pyaoscx/poe_interface.py\", line 69, in get\n    self._get_and_copy_data(depth, selector, self.indices)\n  File \"/usr/local/lib/python3.12/dist-packages/pyaoscx/pyaoscx_module.py\", line 183, in _get_and_copy_data\n    data = self._get_data(depth, selector)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/usr/local/lib/python3.12/dist-packages/pyaoscx/pyaoscx_module.py\", line 225, in _get_data\n    raise GenericOperationError(response.text, response.status_code)\npyaoscx.exceptions.generic_op_error.GenericOperationError: 'GENERIC OPERATION ERROR: \\n: Code: 404'\n",
        "module_stdout": "",
        "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
        "rc": 1
    }

    I seem to be able to get the PoE status through the general Rest API of the switch, so not sure what's going on here. Any ideas/clues would be helpful.

    Thanks in advance.



  • 2.  RE: Ansible aoscx_poe module issues
    Best Answer

    Posted 21 days ago

    Issue solved by upgrading switch firmware.




  • 3.  RE: Ansible aoscx_poe module issues

    Posted 21 days ago

    Happy to hear @DuKe ! can you share which firmware you were originally using and then what you upgraded to?



    ------------------------------
    Ti Chiapuzio-Wong (they/them)
    HPE Aruba Networking
    ------------------------------



  • 4.  RE: Ansible aoscx_poe module issues

    Posted 21 days ago

    I was on the original 'out-of-the-box' firmware PL.10.06.0001 and went to the latest PL.10.14.1010.

    As I'm only testing, I just did this to see if it fixed it, but haven't gone through all the release notes to find out in which version exactly it might have been fixed. :-)