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

[BUG]: file presence not handled in import scp module and reports success when it should report a failure #544

Closed
satoshi-tokyo opened this issue Aug 30, 2023 · 0 comments · Fixed by #566
Labels
needs-triage Issue requires triage. type/bug Something isn't working

Comments

@satoshi-tokyo
Copy link
Contributor

Bug Description

Using idrac_server_config_profile to import scp, in case of scp.json file is not found or named incorrectly, playbook reports with success completion.

Component or Module Name

idrac_server_config_profile

Ansible Version

ansible [core 2.14.1]

Python Version

3.10.2

iDRAC/OME/OME-M version

iDRAC 6.10.30.00

Operating System

N/A

Playbook Used

- hosts: idrac
  name: Server Configuration Profile
  connection: local
  gather_facts: False

  collections:
    - dellemc.openmanage

  tasks:
  - name: Import SCP from a network share and wait for this job to get completed
    idrac_server_config_profile:
      idrac_ip: '{{ idrac_ip }}'
      idrac_user: '{{ idrac_user }}'
      idrac_password: '{{ idrac_password }}'
      command: 'import'
      share_name: '{{ share_name }}'
      scp_file:   '{{ scp_config }}'
      scp_components: 'ALL'
      job_wait: True
      validate_certs: false

Logs

Output when scp.json is found and expected to complete as asuccess:

changed: [idraccb] => {
    "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 V6}",
            "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": "{SCP FILE NAME}.json",
            "share_name": "http://{SCP SHARE PATH}",
            "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-08-28T15:01:07",
        "ActualRunningStopTime": "2023-08-28T15:01:15",
        "CompletionTime": "2023-08-28T15:01:15",
        "Id": "JID_932024672685",
        "JobState": "Completed",
        "JobType": "ImportConfiguration",
        "Message": "Successfully imported and applied Server Configuration Profile.",
        "MessageArgs": [],
        "MessageId": "SYS053",
        "PercentComplete": 100,
        "TargetSettingsURI": null,
        "file": "http://{SCP SHARE PATH}/{SCP FILE NAME}.json",
        "retval": true
    }
}

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

Output when scp.json is NOT found and expected to complete as failure:

ok: [idraccb] => {
    "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 ADDRESS V6}",
            "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": "{SCP FILE NAME}.json",
            "share_name": "http://{SCP SHARE PATH}",
            "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-08-28T15:02:37",
        "ActualRunningStopTime": "2023-08-28T15:02:38",
        "CompletionTime": "2023-08-28T15:02:38",
        "Id": "JID_932025579372",
        "JobState": "Failed",
        "JobType": "ImportConfiguration",
        "Message": "Unable to import the Server Configuration Profile from the network share.",
        "MessageArgs": [],
        "MessageId": "SYS046",
        "PercentComplete": 100,
        "TargetSettingsURI": null,
        "file": "http://{SCP SHARE PATH}/{SCP FILE NAME}.json",
        "retval": true
    }
}

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

Steps to Reproduce

Run a playbook with a wrong scp file name specified to import

Expected Behavior

Playbook to report "ok=0 failed=1" with failure message.

Actual Behavior

Playbook reports "ok=1 failed=0" with "msg": "Successfully imported the Server Configuration Profile."

Screenshots

No response

Additional Information

No response

@satoshi-tokyo satoshi-tokyo added needs-triage Issue requires triage. type/bug Something isn't working labels Aug 30, 2023
@satoshi-tokyo satoshi-tokyo changed the title [BUG]: file presence not handled in import scp module and reports success when fails [BUG]: file presence not handled in import scp module and reports success when it should report a failure Aug 30, 2023
@sachin-apa sachin-apa linked a pull request Oct 20, 2023 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Issue requires triage. type/bug Something isn't working
Projects
None yet
1 participant