community / community.general / 1.3.14 / module / manageiq_alerts Configuration of alerts in ManageIQ Authors: Elad Alfassa (@elad661) <ealfassa@redhat.comcommunity.general.manageiq_alerts (1.3.14) — module
Install with ansible-galaxy collection install community.general:==1.3.14
collections: - name: community.general version: 1.3.14
The manageiq_alerts module supports adding, updating and deleting alerts in ManageIQ.
- name: Add an alert with a "hash expression" to ManageIQ community.general.manageiq_alerts: state: present description: Test Alert 01 options: notifications: email: to: ["example@example.com"] from: "example@example.com" 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: ["example@example.com"] from: "example@example.com" 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
state: choices: - absent - present default: present description: - absent - alert should not exist, - present - alert should exist, required: false type: str enabled: description: - Enable or disable the alert. Required if state is "present". type: bool options: description: - Additional alert options, such as notification type and frequency type: dict expression: description: - The alert expression for ManageIQ. - Can either be in the "Miq Expression" format or the "Hash Expression format". - Required if state is "present". type: dict description: description: - The unique alert description in ManageIQ. - Required when state is "absent" or "present". type: str resource_type: choices: - Vm - ContainerNode - MiqServer - Host - Storage - EmsCluster - ExtManagementSystem - MiddlewareServer description: - The entity type for the alert in ManageIQ. Required when state is "present". type: str expression_type: choices: - hash - miq default: hash description: - Expression type. type: str manageiq_connection: description: - ManageIQ connection configuration information. required: false suboptions: ca_cert: aliases: - ca_bundle_path description: - The path to a CA bundle file or directory with certificates. defaults to None. type: str password: description: - ManageIQ password. C(MIQ_PASSWORD) env var if set. otherwise, required if no token is passed in. type: str token: description: - ManageIQ token. C(MIQ_TOKEN) env var if set. otherwise, required if no username or password is passed in. type: str url: description: - ManageIQ environment url. C(MIQ_URL) env var if set. otherwise, it is required to pass it. required: false type: str username: description: - ManageIQ username. C(MIQ_USERNAME) env var if set. otherwise, required if no token is passed in. type: str validate_certs: aliases: - verify_ssl default: true description: - Whether SSL certificates should be verified for HTTPS requests. defaults to True. type: bool type: dict