aruba / aoscx-ansible-collection

Ansible collections for AOS-CX switches 
47 stars 23 forks source link

frozen runpy #117

Closed willifehler closed 2 weeks ago

willifehler commented 2 weeks ago

Hey there,

I'm trying to loop over a task to delete existing interfaces. Sometimes my task does fail though.

55     - name: Delete existing Interfaces if present before deployment
56        aoscx_l2_interface:
57          interface: "{{ item }}"
58          state: delete
59        loop: "{{ aruba_pre_deployment_delete_aoscx_l2_interface }}"
60        loop_control:
61          pause: 1
  4 aruba_pre_deployment_delete_aoscx_l2_interface:
  5   - "lag1"
  6   - "lag2"
  7   - "lag3"
  8   - "1/1/1"
  9   - "1/1/2"
 10   - "1/1/3"
 11   - "1/1/4"
 12   - "1/1/5"
 13   - "1/1/6"
 14   - "1/1/25"
 15   - "1/1/26"

error:

 9853 An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'interfaces'
 9854 failed: [...] (item=1/1/25) => {"ansible_loop_var": "item", "changed": false, "item": "1/1/25", "module_stderr": "Traceback (most recent call last):\n  File \"/Users/deploy/.ansible/tmp/ansible-local-29440wlj4nsuo/ansible-tmp-1724744056.258461-29443-235686176302974/AnsiballZ_aoscx_l2_interface.py\", line 107, in <module
 9855 >\n    _ansiballz_main()\n  File \"/Users/deploy/.ansible/tmp/ansible-local-29440wlj4nsuo/ansible-tmp-1724744056.258461-29443-235686176302974/AnsiballZ_aoscx_l2_interface.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/Users/deploy/.ansible/tmp/ansible-local-29440wlj4nsuo/ansible-tmp-172474
 9856 4056.258461-29443-235686176302974/AnsiballZ_aoscx_l2_interface.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.arubanetworks.aoscx.plugins.modules.aoscx_l2_interface', init_globals=dict(_module_fqn='ansible_collections.arubanetworks.aoscx.plugins.modules.aoscx_l2_interface', _modlib_path=modlib_path),\n  File \"<frozen r
 9857 unpy>\", 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 \"/var/folders/cq/19329sm51nl5k8wy060r3y6r0000gn/T/ansible_aoscx_l2_interface_payload_f8b2akwe/ansible_aoscx_l2_interface_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/modules/aoscx_l2_interface.p
 9858 y\", line 670, in <module>\n  File \"/var/folders/cq/19329sm51nl5k8wy060r3y6r0000gn/T/ansible_aoscx_l2_interface_payload_f8b2akwe/ansible_aoscx_l2_interface_payload.zip/ansible_collections/arubanetworks/aoscx/plugins/modules/aoscx_l2_interface.py\", line 528, in main\nKeyError: 'interfaces'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr
 9859  for the exact error", "rc": 1}

Has anybody noticed this error as well?

Cheers - Willi

tchiapuziowong commented 2 weeks ago

hi @willifehler can you share what firmware and platform you're using? Are these interfaces that you're attempting to delete are they members of the lag interfaces?

willifehler commented 2 weeks ago

Hey @tchiapuziowong,

...# sh version
-----------------------------------------------------------------------------
ArubaOS-CX
(c) Copyright 2017-2024 Hewlett Packard Enterprise Development LP
-----------------------------------------------------------------------------
Version      : FL.10.13.1010
Build Date   : 2024-04-09 00:34:12 UTC
Build ID     : ArubaOS-CX:FL.10.13.1010:ef2109377880:202404090010
Build SHA    : ef21093778805e954ec130b0939d34927bb7ba19
Hot Patches  :
Active Image : primary

Service OS Version : FL.01.14.0002
BIOS Version       : FL.01.0004

Yes all Interfaces are member of a LAG.

willifehler commented 2 weeks ago

Hey,

I've upgraded my Switches to the latest release and it seems that my issue is gone.

Cheers - Willi