community.general.manageiq_alerts – Configuration of alerts in ManageIQ
community.general.manageiq_alerts – Configuration of alerts in ManageIQ
Note
This plugin is part of the community.general collection (version 2.0.1).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.manageiq_alerts
.
Synopsis
- The manageiq_alerts module supports adding, updating and deleting alerts in ManageIQ.
Requirements
The below requirements are needed on the host that executes this module.
- manageiq-client https://github.com/ManageIQ/manageiq-api-client-python/
Parameters
Parameter | Choices/Defaults | Comments | |
---|---|---|---|
description string |
The unique alert description in ManageIQ. Required when state is "absent" or "present". | ||
enabled boolean |
|
Enable or disable the alert. Required if state is "present". | |
expression dictionary |
The alert expression for ManageIQ. Can either be in the "Miq Expression" format or the "Hash Expression format". Required if state is "present". | ||
expression_type string |
|
Expression type. | |
manageiq_connection dictionary |
ManageIQ connection configuration information. | ||
ca_cert string |
The path to a CA bundle file or directory with certificates. defaults to None.
| ||
password string |
ManageIQ password. | ||
token string |
ManageIQ token. | ||
url string |
ManageIQ environment url. | ||
username string |
ManageIQ username. | ||
validate_certs boolean |
|
Whether SSL certificates should be verified for HTTPS requests. defaults to True.
| |
options dictionary |
Additional alert options, such as notification type and frequency | ||
resource_type string |
|
The entity type for the alert in ManageIQ. Required when state is "present". | |
state string |
|
absent - alert should not exist, present - alert should exist, |
Examples
- name: Add an alert with a "hash expression" to ManageIQ
community.general.manageiq_alerts:
state: present
description: Test Alert 01
options:
notifications:
email:
to: ["[email protected]"]
from: "[email protected]"
resource_type: ContainerNode
expression:
eval_method: hostd_log_threshold
mode: internal
options: {}
enabled: true
manageiq_connection:
url: 'http://127.0.0.1:3000'
username: 'admin'
password: 'smartvm'
validate_certs: False
- name: Add an alert with a "miq expression" to ManageIQ
community.general.manageiq_alerts:
state: present
description: Test Alert 02
options:
notifications:
email:
to: ["[email protected]"]
from: "[email protected]"
resource_type: Vm
expression_type: miq
expression:
and:
- CONTAINS:
tag: Vm.managed-environment
value: prod
- not:
CONTAINS:
tag: Vm.host.managed-environment
value: prod
enabled: true
manageiq_connection:
url: 'http://127.0.0.1:3000'
username: 'admin'
password: 'smartvm'
validate_certs: False
- name: Delete an alert from ManageIQ
community.general.manageiq_alerts:
state: absent
description: Test Alert 01
manageiq_connection:
url: 'http://127.0.0.1:3000'
username: 'admin'
password: 'smartvm'
validate_certs: False
Authors
- Elad Alfassa (@elad661) <[email protected]
© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.11/collections/community/general/manageiq_alerts_module.html