dell / dellemc-openmanage-ansible-modules

Dell OpenManage Ansible Modules
GNU General Public License v3.0
335 stars 163 forks source link

dellemc_idrac_firmware failing with job_wait set to true #102

Closed jallyn18 closed 4 years ago

jallyn18 commented 4 years ago

Hello,

I have the firmware update module working, but it seems that the job_wait parameter causes the playbook to fail when it's set to true.

Version info: Ansible 2.9.3 Dell opensdk 1.2.387 Dell OME Ansible modules 2.0.8 iDRAC versions 3.30.30.30 and 3.34.34.34

My playbook is this:


And it returns the following:

ansible-playbook 2.9.3 config file = /etc/ansible/ansible.cfg configured module search path = [u'/home/vagrant/.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 7 2019, 00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] Using /etc/ansible/ansible.cfg as config file setting up inventory plugins host_list declined parsing /opt/git/private/Ansible-Dev/inventory/firstidrac as it did not pass its verify_file() method script declined parsing /opt/git/private/Ansible-Dev/inventory/firstidrac as it did not pass its verify_file() method auto declined parsing /opt/git/private/Ansible-Dev/inventory/firstidrac as it did not pass its verify_file() method Parsed /opt/git/private/Ansible-Dev/inventory/firstidrac inventory source with ini plugin [DEPRECATION WARNING]: dellemc_idrac_firmware is kept for backwards compatibility but usage is discouraged. The module documentation details page may explain more about this rationale.. This feature will be removed in a future release. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. Loading callback plugin default of type stdout, v2.0 from /usr/lib/python2.7/site-packages/ansible/plugins/callback/default.pyc

PLAYBOOK: update-firmware.yml ***** Positional arguments: OME-dev/update-firmware.yml become_method: sudo inventory: (u'/opt/git/private/Ansible-Dev/inventory/firstidrac',) forks: 5 tags: (u'all',) verbosity: 4 connection: smart timeout: 10 1 plays in OME-dev/update-firmware.yml

PLAY [Update Firmware Inventory] ** META: ran handlers

TASK [Update Firmware Inventory] ** task path: /opt/git/private/Ansible-Dev/OME-dev/update-firmware.yml:8 <127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: vagrant <127.0.0.1> EXEC /bin/sh -c 'echo ~vagrant && sleep 0' <127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /home/vagrant/.ansible/tmp/ansible-tmp-1581536596.67-120414595012312" && echo ansible-tmp-1581536596.67-120414595012312="echo /home/vagrant/.ansible/tmp/ansible-tmp-1581536596.67-120414595012312" ) && sleep 0' Using module file /usr/lib/python2.7/site-packages/ansible/modules/remote_management/dellemc/_dellemc_idrac_firmware.py <127.0.0.1> PUT /home/vagrant/.ansible/tmp/ansible-local-2469zEYCtF/tmppVxy6Z TO /home/vagrant/.ansible/tmp/ansible-tmp-1581536596.67-120414595012312/AnsiballZdellemc_idrac_firmware.py <127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/vagrant/.ansible/tmp/ansible-tmp-1581536596.67-120414595012312/ /home/vagrant/.ansible/tmp/ansible-tmp-1581536596.67-120414595012312/AnsiballZdellemc_idrac_firmware.py && sleep 0' <127.0.0.1> EXEC /bin/sh -c '/usr/bin/python2 /home/vagrant/.ansible/tmp/ansible-tmp-1581536596.67-120414595012312/AnsiballZdellemc_idrac_firmware.py && sleep 0' <127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/vagrant/.ansible/tmp/ansible-tmp-1581536596.67-120414595012312/ > /dev/null 2>&1 && sleep 0' fatal: [localhost]: FAILED! => { "changed": false, "module_stderr": "No handlers could be found for logger \"omsdk.sdkproto\"\nTraceback (most recent call last):\n File \"/home/vagrant/.ansible/tmp/ansible-tmp-1581536596.67-120414595012312/AnsiballZdellemc_idrac_firmware.py\", line 102, in \n _ansiballz_main()\n File \"/home/vagrant/.ansible/tmp/ansible-tmp-1581536596.67-120414595012312/AnsiballZdellemc_idrac_firmware.py\", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/vagrant/.ansible/tmp/ansible-tmp-1581536596.67-120414595012312/AnsiballZ__dellemc_idrac_firmware.py\", line 40, in invoke_module\n runpy.run_module(mod_name='ansible.modules.remote_management.dellemc._dellemc_idrac_firmware', 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_dellemc_idrac_firmware_payload_gEpfgY/ansible_dellemc_idrac_firmware_payload.zip/ansible/modules/remote_management/dellemc/_dellemc_idrac_firmware.py\", line 219, in \n File \"/tmp/ansible_dellemc_idrac_firmware_payload_gEpfgY/ansible_dellemc_idrac_firmware_payload.zip/ansible/modules/remote_management/dellemc/_dellemc_idrac_firmware.py\", line 211, in main\n File \"/tmp/ansible_dellemc_idrac_firmware_payload_gEpfgY/ansible_dellemc_idrac_firmware_payload.zip/ansible/modules/remote_management/dellemc/_dellemc_idrac_firmware.py\", line 170, in update_firmware\n File \"/usr/lib/python2.7/site-packages/omdrivers/lifecycle/iDRAC/iDRACUpdate.py\", line 274, in update_from_repo\n rjson = self._job_mgr._job_wait(rjson['file'], rjson)\n File \"/usr/lib/python2.7/site-packages/omdrivers/lifecycle/iDRAC/iDRACJobs.py\", line 221, in _job_wait\n rjson = self.job_wait(jobid, track_jobid, show_progress)\n File \"/usr/lib/python2.7/site-packages/omdrivers/lifecycle/iDRAC/iDRACJobs.py\", line 244, in job_wait\n status = self.get_job_status_redfish(jobid)\n File \"/usr/lib/python2.7/site-packages/omdrivers/lifecycle/iDRAC/iDRACJobs.py\", line 334, in get_job_status_redfish\n jobdetail = self.get_job_details_redfish(jobid)\n File \"/usr/lib/python2.7/site-packages/omdrivers/lifecycle/iDRAC/iDRACJobs.py\", line 307, in get_job_details_redfish\n retval['StatusCode'] = detail['StatusCode']\nKeyError: 'StatusCode'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1 }

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

rajeevarakkal commented 4 years ago

@jallyn18 this dellemc_idrac_firmware is one of the deprecated module. Can you try with the 'idrac_firmware' module and let us know the details

jallyn18 commented 4 years ago

Thanks Rajeev, that works better, but I guess it's not a true indicator of "waiting" for the job to complete.

The job it is looking at seems to be the repository update job and not the actual updating of firmware components. I don't really know how that could be architected though.

"JobState": "Completed", "JobType": "RepositoryUpdate", "Message": "Job completed successfully.",

rajeevarakkal commented 4 years ago

@jallyn18 thanks. We will check the input you have given and do the needful enhancement if any