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 iDRAC: Allow for specifying an exact manager with 'resource_id' for CreateBiosConfigJob #6370

Merged

Conversation

mraineri
Copy link
Contributor

SUMMARY

'CreateBiosConfigJob' is unique in that it relies on discovering systems and managers. All other commands so far rely on one or the other. So, when a user specifies a 'resource_id' in which to perform the operation, it will always fail one of the checks for a matching system or manager. Since CreateBiosConfigJob only relies on operating upon the first system in the system collection (and not an exact system matching 'resource_id'), the change will only perform 'resource_id' matching on the manager.

Fix #2090

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

idrac_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: BIOS Job
    community.general.idrac_redfish_command:
      category: Systems
      command: CreateBiosConfigJob
      resource_id: iDRAC.Embedded.1
      baseuri: "{{ baseuri }}"
      username: "{{ username }}"
      password: "{{ password }}"
    retries: "{{ default_uri_retries }}"
    register: redfish_results
  - debug:
      var: redfish_results

Before:

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

TASK [BIOS Job] **************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": false, "msg": "Manager resource iDRAC.Embedded.1 not found"}

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

After:

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

TASK [BIOS Job] **************************************************************************************************************************************
changed: [localhost]

TASK [debug] *****************************************************************************************************************************************
ok: [localhost] => {
    "redfish_results": {
        "ansible_facts": {
            "discovered_interpreter_python": "/usr/bin/python3"
        },
        "changed": true,
        "failed": false,
        "msg": "Action was successful"
    }
}

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

…osConfigJob

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

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module plugins plugin (any type) remote_management labels Apr 19, 2023
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-5 and removed check-before-release PR will be looked at again shortly before release and merged if possible. labels Apr 20, 2023
@felixfontein felixfontein merged commit 484f642 into ansible-collections:main Apr 20, 2023
@patchback
Copy link

patchback bot commented Apr 20, 2023

Backport to stable-5: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-5/484f642c23d3884f38297d44e9bd86738a7a61a9/pr-6370

Backported as #6379

🤖 @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 Apr 20, 2023
…d' for CreateBiosConfigJob (#6370)

Allow for specifying an exact manager with 'resource_id' for CreateBiosConfigJob

Signed-off-by: Mike Raineri <michael.raineri@dell.com>
(cherry picked from commit 484f642)
@patchback
Copy link

patchback bot commented Apr 20, 2023

Backport to stable-6: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-6/484f642c23d3884f38297d44e9bd86738a7a61a9/pr-6370

Backported as #6380

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

@felixfontein
Copy link
Collaborator

@mraineri thanks for your contribution!

patchback bot pushed a commit that referenced this pull request Apr 20, 2023
…d' for CreateBiosConfigJob (#6370)

Allow for specifying an exact manager with 'resource_id' for CreateBiosConfigJob

Signed-off-by: Mike Raineri <michael.raineri@dell.com>
(cherry picked from commit 484f642)
felixfontein pushed a commit that referenced this pull request Apr 20, 2023
…fying an exact manager with 'resource_id' for CreateBiosConfigJob (#6380)

Redfish iDRAC: Allow for specifying an exact manager with 'resource_id' for CreateBiosConfigJob (#6370)

Allow for specifying an exact manager with 'resource_id' for CreateBiosConfigJob

Signed-off-by: Mike Raineri <michael.raineri@dell.com>
(cherry picked from commit 484f642)

Co-authored-by: Mike Raineri <michael.raineri@dell.com>
felixfontein pushed a commit that referenced this pull request Apr 20, 2023
…fying an exact manager with 'resource_id' for CreateBiosConfigJob (#6379)

Redfish iDRAC: Allow for specifying an exact manager with 'resource_id' for CreateBiosConfigJob (#6370)

Allow for specifying an exact manager with 'resource_id' for CreateBiosConfigJob

Signed-off-by: Mike Raineri <michael.raineri@dell.com>
(cherry picked from commit 484f642)

Co-authored-by: Mike Raineri <michael.raineri@dell.com>
@mraineri mraineri deleted the Redfish-iDRAC-Resource-Id 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
bug This issue/PR relates to a bug module module plugins plugin (any type) remote_management
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't use CreateBiosConfigJob command from idrac_redfish_command module
3 participants