dellemc.openmanage.ome_session module – Manage OpenManage Enterprise and OpenManage Enterprise modular sessions

Note

This module is part of the dellemc.openmanage collection (version 9.8.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install dellemc.openmanage. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: dellemc.openmanage.ome_session.

New in dellemc.openmanage 9.3.0

Synopsis

  • This module allows you to create and delete sessions on OpenManage Enterprise and OpenManage Enterprise Modular.

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 3.9.6

Parameters

Parameter

Comments

ca_path

path

The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation.

hostname

string

IP address or hostname of the OpenManage Enterprise.

password

string

Password of the OpenManage Enterprise. If the password is not provided, then the environment variable OME_PASSWORD is used.

password is required when state is present.

port

integer

Port of the OpenManage Enterprise.

Default: 443

session_id

string

Session ID of the OpenManage Enterprise.

session_id is required when state is absent.

state

string

The state of the session in OpenManage Enterprise.

present creates a session.

absent deletes a session.

Module will always report changes found to be applied when state is present.

Choices:

  • "present" ← (default)

  • "absent"

timeout

integer

The HTTPS socket level timeout in seconds.

Default: 30

username

string

Username of the OpenManage Enterprise. If the username is not provided, then the environment variable OME_USERNAME is used.

username is required when state is present.

validate_certs

boolean

If false, the SSL certificates will not be validated.

Configure false only on personally controlled sites where self-signed certificates are used.

Choices:

  • false

  • true ← (default)

x_auth_token

aliases: auth_token

string

Authentication token.

x_auth_token is required when state is absent.

Notes

Note

  • Run this module from a system that has direct access to Dell OpenManage Enterprise.

  • This module supports IPv4 and IPv6 addresses.

  • This module supports check_mode.

  • This module will always report changes found to be applied when state is present.

Examples

---
- name: Create a session
  dellemc.openmanage.ome_session:
    hostname: 198.162.0.1
    username: username
    password: password
    ca_path: "/path/to/ca_cert.pem"
    state: present

- name: Delete a session
  dellemc.openmanage.ome_session:
    hostname: 198.162.0.1
    ca_path: "/path/to/ca_cert.pem"
    state: absent
    x_auth_token: aed4aa802b748d2f3b31deec00a6b28a
    session_id: 4b48e9ab-809e-4087-b7c4-201a16e0143d

- name: Create a session and execute other modules
  block:
    - name: Create a session
      dellemc.openmanage.ome_session:
        hostname: 198.162.0.1
        username: username
        password: password
        ca_path: "/path/to/ca_cert.pem"
        state: present
        register: authData

    - name: Call ome_user_info module
      dellemc.openmanage.ome_user_info:
        hostname: 198.162.0.1
        ca_path: "/path/to/ca_cert.pem"
        x_auth_token: "{{ authData.x_auth_token }}"

    - name: Call ome_network_vlan_info module
      dellemc.openmanage.ome_network_vlan_info:
        hostname: 198.162.0.1
        ca_path: "/path/to/ca_cert.pem"
        x_auth_token: "{{ authData.x_auth_token }}"
  always:
    - name: Destroy a session
      dellemc.openmanage.ome_session:
        hostname: 198.162.0.1
        ca_path: "/path/to/ca_cert.pem"
        state: absent
        x_auth_token: "{{ authData.x_auth_token }}"
        session_id: "{{ authData.session_data.Id }}"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

error_info

dictionary

Details of the HTTP Error.

Returned: On HTTP error

Sample: {"error": {"@Message.ExtendedInfo": [{"Message": "Unable to complete the operation because an invalid username and/or password is entered, and therefore authentication failed.", "MessageArgs": [], "MessageArgs@odata.count": 0, "MessageId": "IDRAC.2.7.SYS415", "RelatedProperties": [], "RelatedProperties@odata.count": 0, "Resolution": "Enter valid user name and password and retry the operation.", "Severity": "Warning"}], "code": "Base.1.12.GeneralError", "message": "A general error has occurred. See ExtendedInfo for more information"}}

msg

string

Status of the session operation.

Returned: always

Sample: "The session has been created successfully."

session_data

dictionary

The session details.

Returned: For session creation operation

Sample: {"Description": "admin", "DirectoryGroup": [], "Id": "d5c28d8e-1084-4055-9c01-e1051cfee2dd", "IpAddress": "100.198.162.0", "LastAccessedTimeStamp": "2023-07-03 07:22:43.683", "Name": "API", "Password": null, "Roles": ["BACKUP_ADMINISTRATOR"], "StartTimeStamp": "2023-07-03 07:22:43.683", "UserId": 10078, "UserName": "admin"}

x_auth_token

string

Authentication token.

Returned: For session creation operation

Sample: "d15f17f01cd627c30173b1582642497d"

Authors

  • Kritika Bhateja (@Kritika-Bhateja-03)