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

fix: #486 import scp to wait for job to complete #503

Conversation

satoshi-tokyo
Copy link
Contributor

Description

Use idrac_redfish_job_tracking in module_utils/utils.py to track job progress so that ansible playbook completes after iDRAC SCP import job is actually completed when "job_wait: True".

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #
#486

ISSUE TYPE

  • Bugfix Pull Request
COMPONENT NAME

idrac_server_config_profile.py

OUTPUT
# ansible-playbook import_Config_SCP.yml -i inventory -e scp_config="firmware_scp.json" -vvv
ansible-playbook [core 2.14.1]
~~~~~

PLAYBOOK: import_Config_SCP.yml *******************************************************************
1 plays in import_Config_SCP.yml

PLAY [Server Configuration Profile] ***************************************************************

TASK [Import SCP from a network share and wait for this job to get completed] *********************
~~~~~

changed: [idracca] => {
    "changed": true,
    "invocation": {
        "module_args": {
            "ca_path": null,
            "command": "import",
            "end_host_power_state": "On",
            "export_format": "XML",
            "export_use": "Default",
            "idrac_ip": "{iDRAC_IP_ADDRESS}",
            "idrac_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "idrac_port": 443,
            "idrac_user": "root",
            "ignore_certificate_warning": "ignore",
            "import_buffer": null,
            "include_in_export": "default",
            "job_wait": true,
            "proxy_password": null,
            "proxy_port": "80",
            "proxy_server": null,
            "proxy_support": false,
            "proxy_type": "http",
            "proxy_username": null,
            "scp_components": [
                "ALL"
            ],
            "scp_file": "firmware_scp.json",
            "share_name": "{NFS_ADDRESS}",
            "share_password": null,
            "share_user": null,
            "shutdown_type": "Graceful",
            "timeout": 30,
            "validate_certs": false
        }
    },
    "msg": "Successfully imported the Server Configuration Profile.",
    "scp_status": {
        "ActualRunningStartTime": "2023-04-12T16:33:20",
        "ActualRunningStopTime": "2023-04-12T16:42:49",
        "CompletionTime": "2023-04-12T16:42:49",
        "Id": "JID_812848002970",
        "JobState": "Completed",
        "JobType": "ImportConfiguration",
        "Message": "Successfully imported and applied Server Configuration Profile.",
        "MessageArgs": [],
        "MessageId": "SYS053",
        "PercentComplete": 100,
        "TargetSettingsURI": null,
        "file": "{NFS_ADDRESS}/firmware_scp.json",
        "retval": true
    }
}

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

ADDITIONAL INFORMATION

Tested on PowerEdge R650, iDRAC firmware version: 6.10.30.00


Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have maintained backward compatibility

@sachin-apa
Copy link
Collaborator

@satoshi-tokyo, May I know why there are 110 file changed in this new PR ? Can you please check. Since its anew PR it should ideally hold the Changes you have done for SCP.

@rajshekarp87
Copy link
Contributor

Import operation is failing with HTTP and HTTPS share when job_wait=true. Tested on both iDRAC8 and iDRAC9
iDRAC8 firmware - 2.83.83.83
iDRAC9 firmware - 6.10.80.00

Task output:

fatal: [idrac]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"ca_path": null,
"command": "import",
"end_host_power_state": "On",
"export_format": "XML",
"export_use": "Default",
"idrac_ip": "{{idrac_ip}}",
"idrac_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"idrac_port": 443,
"idrac_user": "root",
"ignore_certificate_warning": "ignore",
"import_buffer": null,
"include_in_export": "default",
"job_wait": true,
"proxy_password": null,
"proxy_port": "80",
"proxy_server": null,
"proxy_support": false,
"proxy_type": "http",
"proxy_username": null,
"scp_components": [
"ALL"
],
"scp_file": "omam_test_scp.json",
"share_name": "{{http/https_share}}",
"share_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"share_user": "{{share_username}}",
"shutdown_type": "Graceful",
"timeout": 30,
"validate_certs": false
}
},
"msg": "Unable to parse json"
}

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

@sachin-apa
Copy link
Collaborator

@satoshi-tokyo Can you please take a look on the above issue and also on no of files in PR.

@satoshi-tokyo
Copy link
Contributor Author

@sachin-apa It looks like because I merged origin/revert-1-collections branch to pass in the previous PR.. I will fix and get back to you

@satoshi-tokyo satoshi-tokyo force-pushed the fix/wait-until-scp-is-applied branch from 4e4cdca to 3c0ca39 Compare June 9, 2023 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants