Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redfish: Add MultipartHTTPPushUpdate #6612

Conversation

mraineri
Copy link
Contributor

SUMMARY

Adds MultipartHTTPPushUpdate to redfish_command to allow a user to push an image directly to a Redfish service via HTTP multipart POST operations. This is an alternative to using the existing SimpleUpdate command, which requires a user to host an image on an external server. The response from the command is the same as the SimpleUpdate command, which allows a user to monitor the update progress the same manner with the GetUpdateStatus command under redfish_info.

Fixes #6471

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

redfish_utils, redfish_command

ADDITIONAL INFORMATION

Sample playbook:

---
- hosts: all
  gather_facts: false
  vars:
    username: REDACTED
    password: REDACTED
    baseuri: REDACTED
    default_uri_timeout: 5
    default_uri_retries: 5
  tasks:
  - name: Multipart push update
    community.general.redfish_command:
      category: Update
      command: MultipartHTTPPushUpdate
      baseuri: "{{ baseuri }}"
      username: "{{ username }}"
      password: "{{ password }}"
      update_image_file: /share/Redfish/Playbooks/iDRAC-with-Lifecycle-Controller_Firmware_Y0CWW_WN64_6.10.80.00_A00.EXE
      update_apply_time: Immediate
      timeout: 600
    retries: "{{ default_uri_retries }}"
    register: redfish_results
  - debug:
      var: redfish_results

PLAY [all] *********************************************************************

TASK [Multipart push update] ***************************************************
changed: [localhost]

TASK [debug] *******************************************************************
ok: [localhost] => {
    "redfish_results": {
        "ansible_facts": {
            "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "failed": false,
        "msg": "Action was successful",
        "return_values": {
            "update_status": {
                "handle": "/redfish/v1/TaskService/Tasks/JID_855671843730",
                "messages": [],
                "resets_requested": [],
                "ret": true,
                "status": "New"
            }
        },
        "session": {}
    }
}

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

Signed-off-by: Mike Raineri <michael.raineri@dell.com>
@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added feature This issue/PR relates to a feature request module module module_utils module_utils plugins plugin (any type) labels May 31, 2023
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels May 31, 2023
Signed-off-by: Mike Raineri <michael.raineri@dell.com>
@ansibullbot ansibullbot removed ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels May 31, 2023
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-7 Automatically create a backport for the stable-7 branch labels Jun 1, 2023
plugins/modules/redfish_command.py Outdated Show resolved Hide resolved
plugins/modules/redfish_command.py Outdated Show resolved Hide resolved
plugins/module_utils/redfish_utils.py Outdated Show resolved Hide resolved
plugins/module_utils/redfish_utils.py Outdated Show resolved Hide resolved
plugins/module_utils/redfish_utils.py Outdated Show resolved Hide resolved
plugins/module_utils/redfish_utils.py Outdated Show resolved Hide resolved
mraineri and others added 6 commits June 1, 2023 08:02
Co-authored-by: Felix Fontein <felix@fontein.de>
…and.yml

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
@ansibullbot ansibullbot added needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Jun 1, 2023
Co-authored-by: Felix Fontein <felix@fontein.de>
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI and removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI labels Jun 1, 2023
Signed-off-by: Mike Raineri <michael.raineri@dell.com>
@ansibullbot ansibullbot removed ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Jun 1, 2023
Signed-off-by: Mike Raineri <michael.raineri@dell.com>
@felixfontein
Copy link
Collaborator

Looks good to me! When you're happy with the PR tell me, then I'll merge.

@mraineri
Copy link
Contributor Author

mraineri commented Jun 5, 2023

I'm good with the changes!

@felixfontein felixfontein merged commit c4e7a94 into ansible-collections:main Jun 5, 2023
136 checks passed
@patchback
Copy link

patchback bot commented Jun 5, 2023

Backport to stable-7: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-7/c4e7a943c0bbb40467dd6fadabe99d8833e7abc5/pr-6612

Backported as #6624

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Jun 5, 2023
patchback bot pushed a commit that referenced this pull request Jun 5, 2023
* Redfish: Add MultipartHTTPPushUpdate

Signed-off-by: Mike Raineri <michael.raineri@dell.com>

* Updates based on CI results

Signed-off-by: Mike Raineri <michael.raineri@dell.com>

* Update plugins/modules/redfish_command.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update changelogs/fragments/6471-redfish-add-multipart-http-push-command.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/redfish_command.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/module_utils/redfish_utils.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/module_utils/redfish_utils.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/module_utils/redfish_utils.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/module_utils/redfish_utils.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Added missing import statement

Signed-off-by: Mike Raineri <michael.raineri@dell.com>

* Added documentation for the usage of 'timeout'

Signed-off-by: Mike Raineri <michael.raineri@dell.com>

---------

Signed-off-by: Mike Raineri <michael.raineri@dell.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit c4e7a94)
@felixfontein
Copy link
Collaborator

@mraineri thanks for your contribution!

@sylgeist
Copy link
Contributor

sylgeist commented Jun 5, 2023

Thank you @mraineri !

felixfontein pushed a commit that referenced this pull request Jun 6, 2023
…Update (#6624)

Redfish: Add MultipartHTTPPushUpdate (#6612)

* Redfish: Add MultipartHTTPPushUpdate

Signed-off-by: Mike Raineri <michael.raineri@dell.com>

* Updates based on CI results

Signed-off-by: Mike Raineri <michael.raineri@dell.com>

* Update plugins/modules/redfish_command.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update changelogs/fragments/6471-redfish-add-multipart-http-push-command.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/redfish_command.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/module_utils/redfish_utils.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/module_utils/redfish_utils.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/module_utils/redfish_utils.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/module_utils/redfish_utils.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Added missing import statement

Signed-off-by: Mike Raineri <michael.raineri@dell.com>

* Added documentation for the usage of 'timeout'

Signed-off-by: Mike Raineri <michael.raineri@dell.com>

---------

Signed-off-by: Mike Raineri <michael.raineri@dell.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit c4e7a94)

Co-authored-by: Mike Raineri <michael.raineri@dell.com>
@mraineri mraineri deleted the Redfish-Multipart-HTTP-Push-Update branch May 17, 2024 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-7 Automatically create a backport for the stable-7 branch feature This issue/PR relates to a feature request module_utils module_utils module module plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redfish Support multi-part HTTP Push Update
4 participants