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 options to check the availability of the service #8434

Merged

Conversation

mraineri
Copy link
Contributor

@mraineri mraineri commented May 28, 2024

SUMMARY
  • Adds new command to check if a Redfish service is available
  • Adds new option to manager reset operations to wait for the service to become available again after the reset

Fix #8051

I did not add a changelog fragment yet; will do that once I get some eyes on the design.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

redfish_info, redfish_command

ADDITIONAL INFORMATION

New "service available" command

---
- hosts: all
  gather_facts: false
  vars:
    baseuri: REDACTED
    username: REDACTED
    password: REDACTED
  tasks:
  - name: Check service availability
    community.general.redfish_info:
      category: Service
      command: CheckAvailability
      baseuri: "{{ baseuri }}"
      username: "{{ username }}"
      password: "{{ password }}"
    register: redfish_results
  - debug:
      var: redfish_results
TASK [debug] *******************************************************************************************************************************************************
ok: [localhost] => {
    "redfish_results": {
        "ansible_facts": {
            "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": false,
        "failed": false,
        "redfish_facts": {
            "service": {
                "available": false,
                "ret": true
            }
        }
    }
}

Usage of new "wait for manager" option in manager power/reset requests:

---
- hosts: all
  gather_facts: false
  vars:
    username: REDACTED
    password: REDACTED
    baseuri: REDACTED
  tasks:
  - name: Reboot manager
    community.general.redfish_command:
      category: Manager
      command: GracefulRestart
      baseuri: "{{ baseuri }}"
      username: "{{ username }}"
      password: "{{ password }}"
      wait: True
    retries: "{{ default_uri_retries }}"
    register: redfish_results
  - debug:
      var: redfish_results
TASK [debug] *******************************************************************************************************************************************************
ok: [localhost] => {
    "redfish_results": {
        "ansible_facts": {
            "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "failed": false,
        "msg": "Action was successful",
        "return_values": {},
        "session": {}
    }
}

Signed-off-by: Mike Raineri <michael.raineri@dell.com>
@mraineri
Copy link
Contributor Author

@glimchb FYI

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added WIP Work in progress feature This issue/PR relates to a feature request module module module_utils module_utils plugins plugin (any type) labels May 28, 2024
Signed-off-by: Mike Raineri <michael.raineri@dell.com>
@ansibullbot ansibullbot added the needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI label May 29, 2024
Signed-off-by: Mike Raineri <michael.raineri@dell.com>
@ansibullbot ansibullbot removed the needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI label May 29, 2024
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-9 Automatically create a backport for the stable-9 branch labels May 30, 2024
Signed-off-by: Mike Raineri <michael.raineri@dell.com>
@mraineri mraineri marked this pull request as ready for review May 30, 2024 14:13
@ansibullbot ansibullbot removed the WIP Work in progress label May 30, 2024
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

changelogs/fragments/8051-Redfish-Wait-For-Service.yml Outdated Show resolved Hide resolved
plugins/modules/redfish_command.py Outdated Show resolved Hide resolved
plugins/modules/redfish_command.py Outdated Show resolved Hide resolved
plugins/modules/redfish_command.py Outdated Show resolved Hide resolved
plugins/modules/redfish_command.py Outdated Show resolved Hide resolved
mraineri and others added 5 commits June 1, 2024 16:24
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>
@mraineri
Copy link
Contributor Author

mraineri commented Jun 1, 2024

@felixfontein I accepted all of your suggestions; thanks for checking it out!

@felixfontein
Copy link
Collaborator

Looks good to me, do you want to wait for more feedback or should I merge?

@mraineri
Copy link
Contributor Author

mraineri commented Jun 3, 2024

I'm good with merging it now; I asked other to review it on a call with me, so there were other eyes on the changes.

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Jun 3, 2024
@felixfontein felixfontein merged commit 961767e into ansible-collections:main Jun 3, 2024
132 checks passed
Copy link

patchback bot commented Jun 3, 2024

Backport to stable-9: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-9/961767e2dd14f09975d6ab2498117f83cc5acfbd/pr-8434

Backported as #8457

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

patchback bot pushed a commit that referenced this pull request Jun 3, 2024
* Redfish: Add options to check the availability of the service

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

* Updates based on review feedback

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

* Updated comment to reflect changed behavior

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

* Added changelog fragments

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

* Update changelogs/fragments/8051-Redfish-Wait-For-Service.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/modules/redfish_command.py

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

* Update plugins/modules/redfish_command.py

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

* Update plugins/modules/redfish_command.py

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

---------

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

@mraineri thanks for your contribution!

felixfontein pushed a commit that referenced this pull request Jun 3, 2024
…the availability of the service (#8457)

Redfish: Add options to check the availability of the service (#8434)

* Redfish: Add options to check the availability of the service

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

* Updates based on review feedback

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

* Updated comment to reflect changed behavior

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

* Added changelog fragments

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

* Update changelogs/fragments/8051-Redfish-Wait-For-Service.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/modules/redfish_command.py

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

* Update plugins/modules/redfish_command.py

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

* Update plugins/modules/redfish_command.py

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

---------

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

Co-authored-by: Mike Raineri <mraineri@gmail.com>
Massl123 pushed a commit to Massl123/community.general that referenced this pull request Feb 7, 2025
…e-collections#8434)

* Redfish: Add options to check the availability of the service

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

* Updates based on review feedback

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

* Updated comment to reflect changed behavior

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

* Added changelog fragments

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

* Update changelogs/fragments/8051-Redfish-Wait-For-Service.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/modules/redfish_command.py

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

* Update plugins/modules/redfish_command.py

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

* Update plugins/modules/redfish_command.py

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

---------

Signed-off-by: Mike Raineri <michael.raineri@dell.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-9 Automatically create a backport for the stable-9 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: Check Service Availability
4 participants