dellemc.openmanage.idrac_diagnostics (9.1.0) — module

Run and Export iDRAC diagnostics

| "added in version" 9.0.0 of dellemc.openmanage"

Authors: Shivam Sharma(@ShivamSh3)

Install collection

Install with ansible-galaxy collection install dellemc.openmanage:==9.1.0


Add to requirements.yml

  collections:
    - name: dellemc.openmanage
      version: 9.1.0

Description

This module allows you to run and export diagnostics on iDRAC.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
---
- name: Run and export the diagnostics to local path
  dellemc.openmanage.idrac_diagnostics:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "path/to/ca_file"
    run: true
    export: true
    share_parameters:
      share_type: "local"
      share_path: "/opt/local/diagnostics/"
      file_name: "diagnostics.txt"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Run the diagnostics with power cycle reboot on schedule
  dellemc.openmanage.idrac_diagnostics:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "path/to/ca_file"
    run: true
    run_mode: "express"
    reboot_type: "power_cycle"
    scheduled_start_time: 20240101101015
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Run and export the diagnostics to HTTPS share
  dellemc.openmanage.idrac_diagnostics:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "path/to/ca_file"
    run: true
    export: true
    share_parameters:
      share_type: "HTTPS"
      ignore_certificate_warning: "on"
      share_name: "/share_path/diagnostics_collection_path"
      ip_address: "192.168.0.2"
      file_name: "diagnostics.txt"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Run and export the diagnostics to NFS share
  dellemc.openmanage.idrac_diagnostics:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "path/to/ca_file"
    run: true
    export: true
    share_parameters:
      share_type: "NFS"
      share_name: "nfsshare/diagnostics_collection_path/"
      ip_address: "192.168.0.3"
      file_name: "diagnostics.txt"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Export the diagnostics to CIFS share
  dellemc.openmanage.idrac_diagnostics:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "path/to/ca_file"
    export: true
    share_parameters:
      share_type: "CIFS"
      share_name: "/cifsshare/diagnostics_collection_path/"
      ip_address: "192.168.0.4"
      file_name: "diagnostics.txt"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Export the diagnostics to HTTPS share via proxy
  dellemc.openmanage.idrac_diagnostics:
    hostname: "192.168.0.1"
    username: "username"
    password: "password"
    ca_path: "path/to/ca_file"
    export: true
    share_parameters:
      share_type: "HTTPS"
      share_name: "/share_path/diagnostics_collection_path"
      ignore_certificate_warning: "on"
      ip_address: "192.168.0.2"
      file_name: "diagnostics.txt"
      proxy_support: parameters_proxy
      proxy_type: http
      proxy_server: "192.168.0.5"
      proxy_port: 1080
      proxy_username: "proxy_user"
      proxy_password: "proxy_password"

Inputs

    
run:
    description:
    - Run the diagnostics job on iDRAC.
    - Run the diagnostics job based on the I(run_mode) and save the report in the internal
      storage. I(reboot_type) is applicable.
    type: bool

export:
    description:
    - Exports the diagnostics information to the given share.
    - This operation requires I(share_parameters).
    - When I(run) is C(true) and I(job_wait) is C(false), only then the run diagnostics
      job is triggered. I(export) is ignored.
    type: bool

ca_path:
    description:
    - The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for
      the validation.
    type: path
    version_added: 5.0.0
    version_added_collection: dellemc.openmanage

timeout:
    default: 30
    description: The socket level timeout in seconds.
    type: int
    version_added: 5.0.0
    version_added_collection: dellemc.openmanage

idrac_ip:
    description: iDRAC IP Address.
    required: true
    type: str

job_wait:
    default: true
    description:
    - Provides the option to wait for job completion.
    - This is applicable when I(run) is C(true) and I(reboot_type) is C(power_cycle).
    - This is applicable only to run the diagnostics job.
    type: bool

run_mode:
    choices:
    - express
    - extended
    - long_run
    default: express
    description:
    - This option provides the choices to run the diagnostics.
    - C(express) The express diagnostics runs a test package for each server subsystem.
      However, it does not run the complete set of tests available in the package for
      each subsystem.
    - C(extended) The extended diagnostics run all available tests in each test package
      for all subsystems.
    - C(long_run) The long-run diagnostics runs express and extended tests.
    type: str

idrac_port:
    default: 443
    description: iDRAC port.
    type: int

idrac_user:
    description:
    - iDRAC username.
    - If the username is not provided, then the environment variable C(IDRAC_USERNAME)
      is used.
    - 'Example: export IDRAC_USERNAME=username'
    required: true
    type: str

reboot_type:
    choices:
    - force
    - graceful
    - power_cycle
    default: graceful
    description:
    - This option provides the choice to reboot the host immediately to run the diagnostics.
    - This is applicable when I(run) is C(true).
    - C(force) Forced graceful shutdown signals the operating system to turn off and wait
      for ten minutes. If the operating system does not turn off, the iDRAC power cycles
      the system.
    - C(graceful) Graceful shutdown waits for the operating system to turn off and wait
      for the system to restart.
    - C(power_cycle) performs a power cycle for a hard reset on the device.
    type: str

resource_id:
    description:
    - Id of the resource.
    - If the value for resource ID is not provided, the module picks the first resource
      ID available from the list of system resources returned by the iDRAC.
    type: str

idrac_password:
    aliases:
    - idrac_pwd
    description:
    - iDRAC user password.
    - If the password is not provided, then the environment variable C(IDRAC_PASSWORD)
      is used.
    - 'Example: export IDRAC_PASSWORD=password'
    required: true
    type: str

validate_certs:
    default: true
    description:
    - If C(false), the SSL certificates will not be validated.
    - Configure C(false) only on personally controlled sites where self-signed certificates
      are used.
    - Prior to collection version C(5.0.0), the I(validate_certs) is C(false) by default.
    type: bool
    version_added: 5.0.0
    version_added_collection: dellemc.openmanage

job_wait_timeout:
    default: 1200
    description:
    - Time in seconds to wait for job completion.
    - This is applicable when I(job_wait) is C(true).
    type: int

share_parameters:
    description:
    - Parameters that are required for the export operation of diagnostics.
    - I(share_parameters) is required when I(export) is C(true).
    suboptions:
      file_name:
        description:
        - Diagnostics file name for I(export) operation.
        type: str
      ignore_certificate_warning:
        choices:
        - 'off'
        - 'on'
        default: 'off'
        description:
        - Ignores the certificate warning while connecting to Share and is only applicable
          when I(share_type) is C(https).
        - C(off) ignores the certificate warning.
        - C(on) does not ignore the certificate warning.
        type: str
      ip_address:
        description:
        - IP address of the network share.
        - I(ip_address) is required when I(share_type) is C(nfs), C(cifs), C(http) or
          C(https).
        type: str
      password:
        description:
        - Password of the network share.
        - I(password) is required when I(share_type) is C(cifs).
        type: str
      proxy_password:
        description:
        - The password of the proxy server.
        - I(proxy_password) is only applicable when I(share_type) is C(http) or C(https)
          and when I(proxy_support) is C(parameters_proxy).
        type: str
      proxy_port:
        default: 80
        description:
        - The port of the proxy server.
        - I(proxy_port) is only applicable when I(share_type) is C(http) or C(https) and
          when I(proxy_support) is C(parameters_proxy).
        type: int
      proxy_server:
        description:
        - The IP address of the proxy server.
        - I(proxy_server) is required when I(proxy_support) is C(parameters_proxy).
        - I(proxy_server) is only applicable when I(share_type) is C(http) or C(https)
          and when I(proxy_support) is C(parameters_proxy).
        type: str
      proxy_support:
        choices:
        - 'off'
        - default_proxy
        - parameters_proxy
        default: 'off'
        description:
        - Specifies if proxy support must be used or not.
        - C(off) does not use proxy settings.
        - C(default_proxy) uses the default proxy settings.
        - C(parameters_proxy) uses the specified proxy settings. I(proxy_server) is required
          when I(proxy_support) is C(parameters_proxy).
        - I(proxy_support) is only applicable when I(share_type) is C(http) or C(https).
        type: str
      proxy_type:
        choices:
        - http
        - socks
        default: http
        description:
        - The proxy type of the proxy server.
        - C(http) to select HTTP proxy.
        - C(socks) to select SOCKS proxy.
        - I(proxy_type) is only applicable when I(share_type) is C(http) or C(https) and
          when I(proxy_support) is C(parameters_proxy).
        type: str
      proxy_username:
        description:
        - The username of the proxy server.
        - I(proxy_username) is only applicable when I(share_type) is C(http) or C(https)
          and when I(proxy_support) is C(parameters_proxy).
        type: str
      share_name:
        description:
        - Network share or local path of the diagnostics file.
        type: str
      share_type:
        choices:
        - local
        - nfs
        - cifs
        - http
        - https
        default: local
        description:
        - Share type of the network share.
        - C(local) uses local path for I(export) operation.
        - C(nfs) uses NFS share for I(export) operation.
        - C(cifs) uses CIFS share for I(export) operation.
        - C(http) uses HTTP share for I(export) operation.
        - C(https) uses HTTPS share for I(export) operation.
        type: str
      username:
        description:
        - Username of the network share.
        - I(username) is required when I(share_type) is C(cifs).
        type: str
      workgroup:
        description:
        - Workgroup of the network share.
        - I(workgroup) is applicable only when I(share_type) is C(cifs).
        type: str
    type: dict

scheduled_end_time:
    description:
    - Run the diagnostic until the specified end date and end time after the I(scheduled_start_time).
    - The accepted formats are yyyymmddhhmmss and YYYY-MM-DDThh:mm:ss+HH:MM.
    - If the run operation does not complete before the specified end time, then the operation
      fails.
    - This is applicable when I(run) is C(True) and I(reboot_type) is C(power_cycle).
    type: str

scheduled_start_time:
    description:
    - Schedules the job at the specified time.
    - The accepted formats are yyyymmddhhmmss and YYYY-MM-DDThh:mm:ss+HH:MM.
    - This is applicable when I(run) is C(true) and I(reboot_type) is power_cycle.
    type: str

Outputs

diagnostics_file_path:
  description: Returns the full path of the diagnostics file.
  returned: For export operation
  sample: /share_path/diagnostics_collection_path/diagnostics.txt
  type: str
error_info:
  description: Details of the HTTP Error.
  returned: on HTTP error
  sample:
    error:
      '@Message.ExtendedInfo':
      - Message: A Remote Diagnostic (ePSA) job already exists.
        MessageArgs: []
        MessageArgs@odata.count: 0
        MessageId: IDRAC.2.9.SYS098
        RelatedProperties: []
        RelatedProperties@odata.count: 0
        Resolution: A response action is not required if the scheduled start time
          of the existing Remote Diagnostic (ePSA) job is ok. Else, delete the existing
          Diagnostics (ePSA) job and recreate another with an appropriate start time.
        Severity: Informational
      code: Base.1.12.GeneralError
      message: A general error has occurred. See ExtendedInfo for more information.
  type: dict
job_details:
  description: Returns the output for status of the job.
  returned: For run and export operations
  sample:
    ActualRunningStartTime: '2024-01-10T10:14:31'
    ActualRunningStopTime: '2024-01-10T10:26:34'
    CompletionTime: '2024-01-10T10:26:34'
    Description: Job Instance
    EndTime: '2024-01-10T10:30:15'
    Id: JID_XXXXXXXXXXXX
    JobState: Completed
    JobType: RemoteDiagnostics
    Message: Job completed successfully.
    MessageArgs: []
    MessageArgs@odata.count: 0
    MessageId: SYS018
    Name: Remote Diagnostics
    PercentComplete: 100
    StartTime: '2024-01-10T10:12:15'
    TargetSettingsURI: null
  type: dict
msg:
  description: Status of the diagnostics operation.
  returned: always
  sample: Successfully ran and exported the diagnostics.
  type: str