HewlettPackard / oneview-ansible

This project is no longer being developed and has limited support. Please use the newer Ansible Collection project: https://github.com/HewlettPackard/oneview-ansible-collection
Apache License 2.0
104 stars 65 forks source link

BUG: oneview_firmware_bundle "state=present" is NOT Idempotent #431

Closed ikegentz closed 4 years ago

ikegentz commented 5 years ago

Scenario/Intent

Attempting to upload an SPP to a Synergy enclosure using the oneview_firmware_bundle module. Re-running the playbook I would expect to see an "OK" response from Ansible if the SPP is already detected to be there.

Environment Details

Steps to Reproduce

  1. Download a recent SPP bundle for Synergy (I am using this one) HPE_Synergy_Custom_SPP_2019.03.20190718_Z7550-96734.iso
  2. Attempt to add it to a OneView Appliance using the oneview_firmware_bundle module in the following manner:
- name: Ensure that firmware bundle (SPP) is present
  oneview_firmware_bundle:
    config: "{{ config_file }}"
    state: present
    file_path: "/tmp/{{ SPP_FIRMWARE_IMAGE }}"
  delegate_to: localhost
  1. Run this task once. You should see the SPP upload successfully to the OneView appliance
  2. Run this task again. Instead of checking to see that the firmware is there and getting the expected OK from Ansible, a generic HTTP 500 error is returned

Expected Result

Instead of an HTTP 500 error, I would expect the oneview_firmware_bundle module to see that the firmware has already been uploaded, and quickly receive an OK message from Ansible.

Actual Result

An HTTP 500 error with this message is returned from Ansible

HPOneViewException: (u'Internal Server Error', {u'errorSource': None, u'recommendedActions': [u'Resend the request. If the error persists, create a support dump and contact your authorized support representative.'], u'nestedErrors': [], u'errorCode': u'GENERIC_HTTP_500', u'details': u'There was a problem while processing the request.  The request might not have completed within the required timeout, or another error might have occurred.', u'message': u'Internal Server Error', u'data': {}})

and then the playbook aborts execution.

sijeesh commented 5 years ago

@ikegentz, I can see that you are using OneView API version 900. We haven't added support for API version 900 yet, the latest supported version is 800. Please try to run your playbook with API version 600 and let us know if any errors.

ikegentz commented 5 years ago

@sijeesh I get the same issue with API version 800 and API version 600.

sijeesh commented 5 years ago

@ikegentz, let me have a look in to this.

frippe75 commented 5 years ago

Experiencing the same issue. Had to place extra code to get the idempotency by running the facts module. Not a nice solution. I'm also seeing the same behaviour with the oneview_server_hardware module.

frippe75 commented 5 years ago

Filed my issue as https://github.com/HewlettPackard/oneview-ansible/issues/439

VenkateshRavula commented 4 years ago

Firmware bundles don't support GET calls and so it is not possible to check if the particular bundle exists in oneview. So we can't make it idempotent.

And also it is mentioned in the "oneview_firmware_bundle" module documentation(line 30) that it is non-idempotent. Closing this issue, since the firmware bundle resource doesn't support the expected functionality.