aruba / aos-switch-ansible-collection

Ansible collection for AOS-Switch switches
67 stars 19 forks source link

aruba reboot module cannot process the msg #10

Closed evalero closed 2 years ago

evalero commented 3 years ago

Aruba : 2930M-48G-PoE+ JL322A FW: WC.16.10.0014 Ansible Ansible 2.9.18 Launched from ansible Tower Tower 3.8.3

Hello everyone!

I have developed a simple playbook to reboot switches:

---
- hosts: arubaos_switches
  collections:
    - arubanetworks.aos_switch
  environment:
    NETWORK_GROUP_MODULES: arubaoss
  tasks:
  - name: Reboot Devices  
    arubanetworks.aos_switch.arubaoss_reboot:
      boot_image: "{{ aossrebootsw_partition }}"
      is_wait: false

  - name: Wait for Switch to be alived
    wait_for:
      host: "{{ inventory_hostname }}"
      port: 22
      state: started
      delay: 30
    delegate_to: localhost

...

When I tried to use the arubaoss_reboot module using FW: 16.10.00.14 this module fails showing the following error (showing entire play for my-switch.my-domain.com)


ansible-playbook 2.9.20
  config file = /tmp/bwrap_50764_cz6kyayo/awx_50764_gpjs1lgh/project/ansible.cfg
  configured module search path = [u'/var/lib/awx/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.5 (default, Aug 13 2020, 02:51:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
Using /tmp/bwrap_50764_cz6kyayo/awx_50764_gpjs1lgh/project/ansible.cfg as config file
SSH password: 
host_list declined parsing /tmp/bwrap_50764_cz6kyayo/awx_50764_gpjs1lgh/tmp1xx0mw23 as it did not pass its verify_file() method
Parsed /tmp/bwrap_50764_cz6kyayo/awx_50764_gpjs1lgh/tmp1xx0mw23 inventory source with script plugin
Skipping callback 'actionable', as we already have a stdout callback.
Skipping callback 'awx_display', as we already have a stdout callback.
Skipping callback 'counter_enabled', as we already have a stdout callback.
Skipping callback 'debug', as we already have a stdout callback.
Skipping callback 'dense', as we already have a stdout callback.
Skipping callback 'dense', as we already have a stdout callback.
Skipping callback 'full_skip', as we already have a stdout callback.
Skipping callback 'json', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'null', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
Skipping callback 'selective', as we already have a stdout callback.
Skipping callback 'skippy', as we already have a stdout callback.
Skipping callback 'stderr', as we already have a stdout callback.
Skipping callback 'unixy', as we already have a stdout callback.
Skipping callback 'yaml', as we already have a stdout callback.

PLAYBOOK: arubaoss_reboot_sw.yml ***********************************************
1 plays in arubaoss_reboot_sw.yml

PLAY [arubaos_switches] ********************************************************
[WARNING]: While constructing a mapping from
/tmp/bwrap_50764_cz6kyayo/awx_50764_gpjs1lgh/project/host_vars/ES-ADA-AES-SA45
.axa-seguros-es.intraxa.yml, line 1, column 1, found a duplicate dict key
(vlan). Using last defined value only.

TASK [Gathering Facts] *********************************************************
task path: /tmp/bwrap_50764_cz6kyayo/awx_50764_gpjs1lgh/project/arubaoss_reboot_sw.yml:2
<my-switch.my-domain.com> ESTABLISH LOCAL CONNECTION FOR USER: awx
<my-switch.my-domain.com> EXEC /bin/sh -c 'echo ~awx && sleep 0'
<my-switch.my-domain.com> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /var/lib/awx/.ansible/tmp `"&& mkdir "` echo /var/lib/awx/.ansible/tmp/ansible-tmp-1623250381.38-19751-85644609147988 `" && echo ansible-tmp-1623250381.38-19751-85644609147988="` echo /var/lib/awx/.ansible/tmp/ansible-tmp-1623250381.38-19751-85644609147988 `" ) && sleep 0'
<my-switch.my-domain.com> Attempting python interpreter discovery
<my-switch.my-domain.com> EXEC /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'/usr/bin/python'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v '"'"'python2.7'"'"'; command -v '"'"'python2.6'"'"'; command -v '"'"'/usr/libexec/platform-python'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && sleep 0'
<my-switch.my-domain.com> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
Using module file /usr/lib/python2.7/site-packages/ansible/modules/system/setup.py
<my-switch.my-domain.com> PUT /var/lib/awx/.ansible/tmp/ansible-local-19722epgqIb/tmpQvH9BZ TO /var/lib/awx/.ansible/tmp/ansible-tmp-1623250381.38-19751-85644609147988/AnsiballZ_setup.py
<my-switch.my-domain.com> EXEC /bin/sh -c 'chmod u+x /var/lib/awx/.ansible/tmp/ansible-tmp-1623250381.38-19751-85644609147988/ /var/lib/awx/.ansible/tmp/ansible-tmp-1623250381.38-19751-85644609147988/AnsiballZ_setup.py && sleep 0'
<my-switch.my-domain.com> EXEC /bin/sh -c 'NETWORK_GROUP_MODULES=arubaoss /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1623250381.38-19751-85644609147988/AnsiballZ_setup.py && sleep 0'
<my-switch.my-domain.com> EXEC /bin/sh -c 'rm -f -r /var/lib/awx/.ansible/tmp/ansible-tmp-1623250381.38-19751-85644609147988/ > /dev/null 2>&1 && sleep 0'
ok: [my-switch.my-domain.com]
META: ran handlers

TASK [aoss_reboot_devices : Reboot Devices] ************************************
task path: /tmp/bwrap_50764_cz6kyayo/awx_50764_gpjs1lgh/project/roles/aoss_reboot_devices/tasks/main.yml:2
<my-switch.my-domain.com> ESTABLISH LOCAL CONNECTION FOR USER: awx
<my-switch.my-domain.com> EXEC /bin/sh -c 'echo ~awx && sleep 0'
<my-switch.my-domain.com> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /var/lib/awx/.ansible/tmp `"&& mkdir "` echo /var/lib/awx/.ansible/tmp/ansible-tmp-1623250383.23-20011-88382299963862 `" && echo ansible-tmp-1623250383.23-20011-88382299963862="` echo /var/lib/awx/.ansible/tmp/ansible-tmp-1623250383.23-20011-88382299963862 `" ) && sleep 0'
Using module file /tmp/bwrap_50764_cz6kyayo/awx_50764_gpjs1lgh/requirements_collections/ansible_collections/arubanetworks/aos_switch/plugins/modules/arubaoss_reboot.py
<my-switch.my-domain.com> PUT /var/lib/awx/.ansible/tmp/ansible-local-19722epgqIb/tmp2ja8Re TO /var/lib/awx/.ansible/tmp/ansible-tmp-1623250383.23-20011-88382299963862/AnsiballZ_arubaoss_reboot.py
<my-switch.my-domain.com> EXEC /bin/sh -c 'chmod u+x /var/lib/awx/.ansible/tmp/ansible-tmp-1623250383.23-20011-88382299963862/ /var/lib/awx/.ansible/tmp/ansible-tmp-1623250383.23-20011-88382299963862/AnsiballZ_arubaoss_reboot.py && sleep 0'
<my-switch.my-domain.com> EXEC /bin/sh -c 'NETWORK_GROUP_MODULES=arubaoss /usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1623250383.23-20011-88382299963862/AnsiballZ_arubaoss_reboot.py && sleep 0'
<my-switch.my-domain.com> EXEC /bin/sh -c 'rm -f -r /var/lib/awx/.ansible/tmp/ansible-tmp-1623250383.23-20011-88382299963862/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/var/lib/awx/.ansible/tmp/ansible-tmp-1623250383.23-20011-88382299963862/AnsiballZ_arubaoss_reboot.py", line 102, in <module>
    _ansiballz_main()
  File "/var/lib/awx/.ansible/tmp/ansible-tmp-1623250383.23-20011-88382299963862/AnsiballZ_arubaoss_reboot.py", line 94, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/var/lib/awx/.ansible/tmp/ansible-tmp-1623250383.23-20011-88382299963862/AnsiballZ_arubaoss_reboot.py", line 40, in invoke_module
    runpy.run_module(mod_name='ansible_collections.arubanetworks.aos_switch.plugins.modules.arubaoss_reboot', init_globals=None, run_name='__main__', alter_sys=True)
  File "/usr/lib64/python2.7/runpy.py", line 176, in run_module
    fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 82, in _run_module_code
    mod_name, mod_fname, mod_loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/tmp/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload_hx4wHk/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload.zip/ansible_collections/arubanetworks/aos_switch/plugins/modules/arubaoss_reboot.py", line 152, in <module>
  File "/tmp/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload_hx4wHk/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload.zip/ansible_collections/arubanetworks/aos_switch/plugins/modules/arubaoss_reboot.py", line 148, in main
  File "/tmp/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload_hx4wHk/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload.zip/ansible_collections/arubanetworks/aos_switch/plugins/modules/arubaoss_reboot.py", line 142, in run_module
  File "/tmp/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload_hx4wHk/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload.zip/ansible/module_utils/basic.py", line 2196, in fail_json
  File "/tmp/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload_hx4wHk/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload.zip/ansible/module_utils/basic.py", line 2168, in _return_formatted
  File "/tmp/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload_hx4wHk/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload.zip/ansible/module_utils/basic.py", line 426, in remove_values
  File "/tmp/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload_hx4wHk/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload.zip/ansible/module_utils/basic.py", line 403, in _remove_values_conditions
TypeError: Value of unknown type: <type 'exceptions.KeyError'>, 'message'
fatal: [my-switch.my-domain.com]: FAILED! => {
    "changed": false, 
    "module_stderr": "Traceback (most recent call last):\\n  File \\"/var/lib/awx/.ansible/tmp/ansible-tmp-1623250383.23-20011-88382299963862/AnsiballZ_arubaoss_reboot.py\\", line 102, in <module>\\n    _ansiballz_main()\\n  File \\"/var/lib/awx/.ansible/tmp/ansible-tmp-1623250383.23-20011-88382299963862/AnsiballZ_arubaoss_reboot.py\\", line 94, in _ansiballz_main\\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\\n  File \\"/var/lib/awx/.ansible/tmp/ansible-tmp-1623250383.23-20011-88382299963862/AnsiballZ_arubaoss_reboot.py\\", line 40, in invoke_module\\n    runpy.run_module(mod_name='ansible_collections.arubanetworks.aos_switch.plugins.modules.arubaoss_reboot', init_globals=None, run_name='__main__', alter_sys=True)\\n  File \\"/usr/lib64/python2.7/runpy.py\\", line 176, in run_module\\n    fname, loader, pkg_name)\\n  File \\"/usr/lib64/python2.7/runpy.py\\", line 82, in _run_module_code\\n    mod_name, mod_fname, mod_loader, pkg_name)\\n  File \\"/usr/lib64/python2.7/runpy.py\\", line 72, in _run_code\\n    exec code in run_globals\\n  File \\"/tmp/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload_hx4wHk/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload.zip/ansible_collections/arubanetworks/aos_switch/plugins/modules/arubaoss_reboot.py\\", line 152, in <module>\\n  File \\"/tmp/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload_hx4wHk/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload.zip/ansible_collections/arubanetworks/aos_switch/plugins/modules/arubaoss_reboot.py\\", line 148, in main\\n  File \\"/tmp/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload_hx4wHk/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload.zip/ansible_collections/arubanetworks/aos_switch/plugins/modules/arubaoss_reboot.py\\", line 142, in run_module\\n  File \\"/tmp/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload_hx4wHk/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload.zip/ansible/module_utils/basic.py\\", line 2196, in fail_json\\n  File \\"/tmp/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload_hx4wHk/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload.zip/ansible/module_utils/basic.py\\", line 2168, in _return_formatted\\n  File \\"/tmp/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload_hx4wHk/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload.zip/ansible/module_utils/basic.py\\", line 426, in remove_values\\n  File \\"/tmp/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload_hx4wHk/ansible_arubanetworks.aos_switch.arubaoss_reboot_payload.zip/ansible/module_utils/basic.py\\", line 403, in _remove_values_conditions\\nTypeError: Value of unknown type: <type 'exceptions.KeyError'>, 'message'\\n", 
    "module_stdout": "", 
    "msg": "MODULE FAILURE\\nSee stdout/stderr for the exact error", 
    "rc": 1
}

PLAY RECAP *********************************************************************
my-switch.my-domain.com : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   

We have tested whis playbook using deprecated aruba-modules (we are migrating them into the collections) and form other host https://github.com/aruba/aruba-ansible-modules

And we get the following error:


ansible-playbook 2.9.18
  config file = /tmp/bwrap_50352_55qqdupi/awx_50352_qan_g5lc/project/ansible.cfg
  configured module search path = [u'/var/lib/awx/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.5 (default, Nov 11 2020, 06:52:19) [GCC 4.8.5 20150623 (SuSE 4.8.5-44)]
Using /tmp/bwrap_50352_55qqdupi/awx_50352_qan_g5lc/project/ansible.cfg as config file
SSH password: 
host_list declined parsing /tmp/bwrap_50352_55qqdupi/awx_50352_qan_g5lc/tmpz85xhzrv as it did not pass its verify_file() method
Parsed /tmp/bwrap_50352_55qqdupi/awx_50352_qan_g5lc/tmpz85xhzrv inventory source with script plugin
Skipping callback 'actionable', as we already have a stdout callback.
Skipping callback 'awx_display', as we already have a stdout callback.
Skipping callback 'counter_enabled', as we already have a stdout callback.
Skipping callback 'debug', as we already have a stdout callback.
Skipping callback 'dense', as we already have a stdout callback.
Skipping callback 'dense', as we already have a stdout callback.
Skipping callback 'full_skip', as we already have a stdout callback.
Skipping callback 'json', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'null', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
Skipping callback 'selective', as we already have a stdout callback.
Skipping callback 'skippy', as we already have a stdout callback.
Skipping callback 'stderr', as we already have a stdout callback.
Skipping callback 'unixy', as we already have a stdout callback.
Skipping callback 'yaml', as we already have a stdout callback.

PLAYBOOK: arubaoss_reboot_sw.yml ***********************************************
1 plays in arubaoss_reboot_sw.yml

PLAY [arubaos_switches] ********************************************************

TASK [Gathering Facts] *********************************************************
task path: /tmp/bwrap_50352_55qqdupi/awx_50352_qan_g5lc/project/arubaoss_reboot_sw.yml:2
<my-switch.my-domain.com > ESTABLISH LOCAL CONNECTION FOR USER: awx
<my-switch.my-domain.com > EXEC /bin/sh -c 'echo ~awx && sleep 0'
<my-switch.my-domain.com > EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /var/lib/awx/.ansible/tmp `"&& mkdir "` echo /var/lib/awx/.ansible/tmp/ansible-tmp-1623150438.17-126246-214853390633534 `" && echo ansible-tmp-1623150438.17-126246-214853390633534="` echo /var/lib/awx/.ansible/tmp/ansible-tmp-1623150438.17-126246-214853390633534 `" ) && sleep 0'
<my-switch.my-domain.com > Attempting python interpreter discovery
<my-switch.my-domain.com > EXEC /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'/usr/bin/python'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v '"'"'python2.7'"'"'; command -v '"'"'python2.6'"'"'; command -v '"'"'/usr/libexec/platform-python'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && sleep 0'
<my-switch.my-domain.com > EXEC /bin/sh -c '/usr/bin/python && sleep 0'
Using module file /usr/lib/python2.7/site-packages/ansible/modules/system/setup.py
<my-switch.my-domain.com > PUT /var/lib/awx/.ansible/tmp/ansible-local-126234vIWT_V/tmpnIc39_ TO /var/lib/awx/.ansible/tmp/ansible-tmp-1623150438.17-126246-214853390633534/AnsiballZ_setup.py
<my-switch.my-domain.com > EXEC /bin/sh -c 'chmod u+x /var/lib/awx/.ansible/tmp/ansible-tmp-1623150438.17-126246-214853390633534/ /var/lib/awx/.ansible/tmp/ansible-tmp-1623150438.17-126246-214853390633534/AnsiballZ_setup.py && sleep 0'
<my-switch.my-domain.com > EXEC /bin/sh -c '/usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1623150438.17-126246-214853390633534/AnsiballZ_setup.py && sleep 0'
<my-switch.my-domain.com > EXEC /bin/sh -c 'rm -f -r /var/lib/awx/.ansible/tmp/ansible-tmp-1623150438.17-126246-214853390633534/ > /dev/null 2>&1 && sleep 0'
ok: [my-switch.my-domain.com ]
META: ran handlers

TASK [aoss_reboot_devices : Reboot Devices] ************************************
task path: /tmp/bwrap_50352_55qqdupi/awx_50352_qan_g5lc/project/roles/aoss_reboot_devices/tasks/main.yml:2
<my-switch.my-domain.com > ESTABLISH LOCAL CONNECTION FOR USER: awx
<my-switch.my-domain.com > EXEC /bin/sh -c 'echo ~awx && sleep 0'
<my-switch.my-domain.com > EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /var/lib/awx/.ansible/tmp `"&& mkdir "` echo /var/lib/awx/.ansible/tmp/ansible-tmp-1623150440.43-126460-274828992143354 `" && echo ansible-tmp-1623150440.43-126460-274828992143354="` echo /var/lib/awx/.ansible/tmp/ansible-tmp-1623150440.43-126460-274828992143354 `" ) && sleep 0'
Using module file /usr/lib/python2.7/site-packages/ansible/modules/network/arubaoss/arubaoss_reboot.py
<my-switch.my-domain.com > PUT /var/lib/awx/.ansible/tmp/ansible-local-126234vIWT_V/tmpgYoDWU TO /var/lib/awx/.ansible/tmp/ansible-tmp-1623150440.43-126460-274828992143354/AnsiballZ_arubaoss_reboot.py
<my-switch.my-domain.com > EXEC /bin/sh -c 'chmod u+x /var/lib/awx/.ansible/tmp/ansible-tmp-1623150440.43-126460-274828992143354/ /var/lib/awx/.ansible/tmp/ansible-tmp-1623150440.43-126460-274828992143354/AnsiballZ_arubaoss_reboot.py && sleep 0'
<my-switch.my-domain.com > EXEC /bin/sh -c '/usr/bin/python /var/lib/awx/.ansible/tmp/ansible-tmp-1623150440.43-126460-274828992143354/AnsiballZ_arubaoss_reboot.py && sleep 0'
<my-switch.my-domain.com > EXEC /bin/sh -c 'rm -f -r /var/lib/awx/.ansible/tmp/ansible-tmp-1623150440.43-126460-274828992143354/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/var/lib/awx/.ansible/tmp/ansible-tmp-1623150440.43-126460-274828992143354/AnsiballZ_arubaoss_reboot.py", line 102, in <module>
    _ansiballz_main()
  File "/var/lib/awx/.ansible/tmp/ansible-tmp-1623150440.43-126460-274828992143354/AnsiballZ_arubaoss_reboot.py", line 94, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/var/lib/awx/.ansible/tmp/ansible-tmp-1623150440.43-126460-274828992143354/AnsiballZ_arubaoss_reboot.py", line 40, in invoke_module
    runpy.run_module(mod_name='ansible.modules.network.arubaoss.arubaoss_reboot', init_globals=None, run_name='__main__', alter_sys=True)
  File "/usr/lib64/python2.7/runpy.py", line 176, in run_module
    fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 82, in _run_module_code
    mod_name, mod_fname, mod_loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/tmp/ansible_arubaoss_reboot_payload_qw6j7A/ansible_arubaoss_reboot_payload.zip/ansible/modules/network/arubaoss/arubaoss_reboot.py", line 156, in <module>
  File "/tmp/ansible_arubaoss_reboot_payload_qw6j7A/ansible_arubaoss_reboot_payload.zip/ansible/modules/network/arubaoss/arubaoss_reboot.py", line 153, in main
  File "/tmp/ansible_arubaoss_reboot_payload_qw6j7A/ansible_arubaoss_reboot_payload.zip/ansible/modules/network/arubaoss/arubaoss_reboot.py", line 147, in run_module
  File "/tmp/ansible_arubaoss_reboot_payload_qw6j7A/ansible_arubaoss_reboot_payload.zip/ansible/module_utils/basic.py", line 2196, in fail_json
  File "/tmp/ansible_arubaoss_reboot_payload_qw6j7A/ansible_arubaoss_reboot_payload.zip/ansible/module_utils/basic.py", line 2168, in _return_formatted
  File "/tmp/ansible_arubaoss_reboot_payload_qw6j7A/ansible_arubaoss_reboot_payload.zip/ansible/module_utils/basic.py", line 426, in remove_values
  File "/tmp/ansible_arubaoss_reboot_payload_qw6j7A/ansible_arubaoss_reboot_payload.zip/ansible/module_utils/basic.py", line 403, in _remove_values_conditions
TypeError: Value of unknown type: <type 'exceptions.KeyError'>, 'message'
fatal: [my-switch.my-domain.com ]: FAILED! => {
    "changed": false, 
    "module_stderr": "Traceback (most recent call last):\\n  File \\"/var/lib/awx/.ansible/tmp/ansible-tmp-1623150440.43-126460-274828992143354/AnsiballZ_arubaoss_reboot.py\\", line 102, in <module>\\n    _ansiballz_main()\\n  File \\"/var/lib/awx/.ansible/tmp/ansible-tmp-1623150440.43-126460-274828992143354/AnsiballZ_arubaoss_reboot.py\\", line 94, in _ansiballz_main\\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\\n  File \\"/var/lib/awx/.ansible/tmp/ansible-tmp-1623150440.43-126460-274828992143354/AnsiballZ_arubaoss_reboot.py\\", line 40, in invoke_module\\n    runpy.run_module(mod_name='ansible.modules.network.arubaoss.arubaoss_reboot', init_globals=None, run_name='__main__', alter_sys=True)\\n  File \\"/usr/lib64/python2.7/runpy.py\\", line 176, in run_module\\n    fname, loader, pkg_name)\\n  File \\"/usr/lib64/python2.7/runpy.py\\", line 82, in _run_module_code\\n    mod_name, mod_fname, mod_loader, pkg_name)\\n  File \\"/usr/lib64/python2.7/runpy.py\\", line 72, in _run_code\\n    exec code in run_globals\\n  File \\"/tmp/ansible_arubaoss_reboot_payload_qw6j7A/ansible_arubaoss_reboot_payload.zip/ansible/modules/network/arubaoss/arubaoss_reboot.py\\", line 156, in <module>\\n  File \\"/tmp/ansible_arubaoss_reboot_payload_qw6j7A/ansible_arubaoss_reboot_payload.zip/ansible/modules/network/arubaoss/arubaoss_reboot.py\\", line 153, in main\\n  File \\"/tmp/ansible_arubaoss_reboot_payload_qw6j7A/ansible_arubaoss_reboot_payload.zip/ansible/modules/network/arubaoss/arubaoss_reboot.py\\", line 147, in run_module\\n  File \\"/tmp/ansible_arubaoss_reboot_payload_qw6j7A/ansible_arubaoss_reboot_payload.zip/ansible/module_utils/basic.py\\", line 2196, in fail_json\\n  File \\"/tmp/ansible_arubaoss_reboot_payload_qw6j7A/ansible_arubaoss_reboot_payload.zip/ansible/module_utils/basic.py\\", line 2168, in _return_formatted\\n  File \\"/tmp/ansible_arubaoss_reboot_payload_qw6j7A/ansible_arubaoss_reboot_payload.zip/ansible/module_utils/basic.py\\", line 426, in remove_values\\n  File \\"/tmp/ansible_arubaoss_reboot_payload_qw6j7A/ansible_arubaoss_reboot_payload.zip/ansible/module_utils/basic.py\\", line 403, in _remove_values_conditions\\nTypeError: Value of unknown type: <type 'exceptions.KeyError'>, 'message'\\n", 
    "module_stdout": "", 
    "msg": "MODULE FAILURE\\nSee stdout/stderr for the exact error", 
    "rc": 1
}

PLAY RECAP *********************************************************************
my-switch.my-domain.com  : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   

As you can see, we get the same exception on both cases.

But we have downgraded the switch into FW 16.10.00.12 this job finish succesffully using both the deprecated modules or the collection:



SSH password: 

PLAY [arubaos_switches] ********************************************************

TASK [Gathering Facts] *********************************************************
ok: [my-switch.my-domain.com ]

TASK [aoss_reboot_devices : Reboot Devices] ************************************
changed: [my-switch.my-domain.com ]

TASK [aoss_reboot_devices : Wait for Switch to be alived] **********************
ok: [my-switch.my-domain.com ]

PLAY RECAP *********************************************************************
my-switch.my-domain.com  : ok=3    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

**expected behaviour**

Still be able to reboot switches after FW version upgrade
josaw44 commented 3 years ago

Thank you so much Ernest, I just open the SR 5356293317 on Aruba Web support page to help to investigate with the issue.

tchiapuziowong commented 2 years ago

Closing issue since known REST API issue with firmware - suggestion to use SSH modules to boot to different firmware