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: idrac_server_config_profile.py to wait until scp is applied #3

Closed
wants to merge 0 commits into from

Conversation

satoshi-tokyo
Copy link
Owner

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 #
dell#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

@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.

1 participant