dellemc.openmanage.ome_alert_policies module – Manage OME alert policies.
Note
This module is part of the dellemc.openmanage collection (version 9.9.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_alert_policies
.
New in dellemc.openmanage 8.3.0
Synopsis
This module allows you to create, modify, or delete alert policies on OpenManage Enterprise or OpenManage Enterprise Modular.
Requirements
The below requirements are needed on the host that executes this module.
python >= 3.9.6
Parameters
Parameter |
Comments |
---|---|
Actions to be triggered for the alert policy. This parameter is case-sensitive. This is mandatory for creating a policy and optional for updating a policy. This is applicable only when state is |
|
Name of the action. This is fetched from the dellemc.openmanage.ome_alert_policies_action_info. This is mandatory for creating a policy and optional for updating a policy. This parameter is case-sensitive. |
|
Predefined parameters required to set for action_name. Default: |
|
Name of the predefined parameter. This is fetched from the dellemc.openmanage.ome_alert_policies_action_info. |
|
Value of the predefined parameter. These values will not be validated. |
|
This option indicates whether the alert policy is applicable to all the discovered and undiscovered devices or not. This option is mutually exclusive with device_service_tag, specific_undiscovered_devices, any_undiscovered_devices and device_group. This is applicable only when state is Choices:
|
|
This option indicates whether the alert policy is applicable to any undiscovered devices or not. This option is mutually exclusive with device_service_tag, specific_undiscovered_devices, device_group and all_devices. This is applicable only when state is Choices:
|
|
The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. |
|
Category of the alerts received. This is mutually exclusive with the message_ids, message_file. This is fetched from the dellemc.openmanage.ome_alert_policies_category_info. This is applicable only when state is |
|
Category of the catalog. |
|
Name of the category. |
|
List of sub-categories. |
|
Name of the catalog. |
|
Specifies the schedule for when the alert policy is applicable. date_and_time is mandatory for creating a policy and optional when updating a policy. This is applicable only when state is |
|
Start date in the format YYYY-MM-DD. This parameter to be provided in quotes. |
|
End date in the format YYYY-MM-DD. This parameter to be provided in quotes. |
|
Required days of the week on which alert policy operation must be scheduled. Choices:
|
|
Interval start time in the format HH:MM This parameter to be provided in quotes. This is mandatory when time_interval is |
|
Enable the time interval for which alert policy must be scheduled. Choices:
|
|
Interval end time in the format HH:MM This parameter to be provided in quotes. This is mandatory when time_interval is |
|
Description for the alert policy. This is applicable only when state is |
|
List of device group names on which the alert policy is applicable. This option is mutually exclusive with device_service_tag, specific_undiscovered_devices, any_undiscovered_devices and all_devices . This is applicable only when state is |
|
List of device service tags on which the alert policy will be applicable. This option is mutually exclusive with device_group, specific_undiscovered_devices, any_undiscovered_devices and all_devices. This is applicable only when state is |
|
This is applicable only when state is Choices:
|
|
OpenManage Enterprise or OpenManage Enterprise Modular IP address or hostname. |
|
Local path of a CSV formatted file with message IDs This is mutually exclusive with the category, message_ids This is applicable only when state is This is fetched from the dellemc.openmanage.ome_alert_policies_message_id_info. |
|
List of Message ids This is mutually exclusive with the category, message_file This is applicable only when state is This is fetched from the dellemc.openmanage.ome_alert_policies_message_id_info. |
|
Name of an alert policy or a list of alert policies. More than one policy name is applicable when state is |
|
New name for the alert policy. This is applicable only when state is |
|
OpenManage Enterprise or OpenManage Enterprise Modular password. If the password is not provided, then the environment variable Example: export OME_PASSWORD=password |
|
OpenManage Enterprise or OpenManage Enterprise Modular HTTPS port. Default: |
|
Severity of the alert policy. This is mandatory for creating a policy and optional for updating a policy. This is applicable only when state is Choices:
|
|
List of undiscovered IPs, hostnames, or range of IPs of devices on which the alert policy is applicable. This option is mutually exclusive with device_service_tag, device_group, any_undiscovered_devices and all_devices . This is applicable only when state is Examples of valid IP range format: 10.35.0.0 10.36.0.0-10.36.0.255 10.37.0.0/24 2607:f2b1:f083:135::5500/118 2607:f2b1:f083:135::a500-2607:f2b1:f083:135::a600 hostname.domain.com Examples of invalid IP range format: 10.35.0.* 10.36.0.0-255 10.35.0.0/255.255.255.0 These values will not be validated. |
|
Choices:
|
|
The socket level timeout in seconds. Default: |
|
OpenManage Enterprise or OpenManage Enterprise Modular username. If the username is not provided, then the environment variable Example: export OME_USERNAME=username |
|
If Configure Prior to collection version Choices:
|
|
Authentication token. If the x_auth_token is not provided, then the environment variable Example: export OME_X_AUTH_TOKEN=x_auth_token |
Notes
Note
Run this module from a system that has direct access to Dell OpenManage Enterprise or OpenManage Enterprise Modular.
This module supports IPv4 and IPv6 addresses.
This module supports
check_mode
.
Examples
---
- name: "Create an alert policy"
dellemc.openamanage.ome_alert_policies:
hostname: "192.168.0.1"
username: "username"
password: "password"
ca_path: "/path/to/ca_cert.pem"
name: "Alert Policy One"
device_service_tag:
- ABCD123
- SVC7845
category:
- catalog_name: Application
catalog_category:
- category_name: Audit
sub_category_names:
- Generic
- Devices
- catalog_name: iDRAC
catalog_category:
- category_name: Audit
sub_category_names:
- BIOS Management
- iDRAC Service Module
date_and_time:
date_from: "2023-10-10"
date_to: "2023-10-11"
time_from: "11:00"
time_to: "12:00"
severity:
- unknown
- critical
actions:
- action_name: Trap
parameters:
- name: "192.1.2.3:162"
value: true
- name: "traphostname.domain.com:162"
value: true
tags: create_alert_policy
- name: "Update an alert Policy"
dellemc.openamanage.ome_alert_policies:
hostname: "192.168.0.1"
username: "username"
password: "password"
ca_path: "/path/to/ca_cert.pem"
new_name: "Update Policy Name"
device_group: "Group Name"
message_ids:
- AMP400
- CTL201
- BIOS101
date_and_time:
date_from: "2023-10-10"
date_to: "2023-10-11"
time_from: "11:00"
time_to: "12:00"
time_interval: true
actions:
- action_name: Trap
parameters:
- name: "192.1.2.3:162"
value: true
tags: update_alert_policy
- name: "Enable an alert policy"
dellemc.openamanage.ome_alert_policies:
hostname: "192.168.0.1"
username: "username"
password: "password"
ca_path: "/path/to/ca_cert.pem"
name: "Policy Name"
enable: true
tags: enable_alert_policy
- name: "Disable multiple alert policies"
dellemc.openamanage.ome_alert_policies:
hostname: "192.168.0.1"
username: "username"
password: "password"
ca_path: "/path/to/ca_cert.pem"
name:
- "Policy Name 1"
- "Policy Name 2"
enable: false
tags: disable_alert_policy
- name: "Delete an alert policy"
dellemc.openamanage.ome_alert_policies:
hostname: "192.168.0.1"
username: "username"
password: "password"
ca_path: "/path/to/ca_cert.pem"
name:
- "Policy Name"
state: absent
tags: delete_alert_policy
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Details of the HTTP Error. Returned: on HTTP error Sample: |
|
Status of the alert policies operation. Returned: always Sample: |
|
The policy which was created or modified. Returned: when state is present Sample: |