community / community.general / 8.5.0 / module / rax_mon_alarm
Removed in 9.0.0
Reason:This module relies on the deprecated package pyrax. | Alternative:Use the Openstack modules instead.
Create or delete a Rackspace Cloud Monitoring alarm
Authors: Ash Wilson (@smashwilson)
Install with ansible-galaxy collection install community.general:==8.5.0
collections: - name: community.general version: 8.5.0
Create or delete a Rackspace Cloud Monitoring alarm that associates an existing rax_mon_entity, rax_mon_check, and rax_mon_notification_plan with criteria that specify what conditions will trigger which levels of notifications. Rackspace monitoring module flow | rax_mon_entity -> rax_mon_check -> rax_mon_notification -> rax_mon_notification_plan -> *rax_mon_alarm*
- name: Alarm example gather_facts: false hosts: local connection: local tasks: - name: Ensure that a specific alarm exists. community.general.rax_mon_alarm: credentials: ~/.rax_pub state: present label: uhoh entity_id: "{{ the_entity['entity']['id'] }}" check_id: "{{ the_check['check']['id'] }}" notification_plan_id: "{{ defcon1['notification_plan']['id'] }}" criteria: > if (rate(metric['average']) > 10) { return new AlarmStatus(WARNING); } return new AlarmStatus(OK); register: the_alarm
env: description: - Environment as configured in C(~/.pyrax.cfg), see U(https://github.com/rackspace/pyrax/blob/master/docs/getting_started.md#pyrax-configuration). type: str label: description: - Friendly name for this alarm, used to achieve idempotence. Must be a String between 1 and 255 characters long. required: true type: str state: choices: - present - absent default: present description: - Ensure that the alarm with this O(label) exists or does not exist. required: false type: str region: description: - Region to create an instance in. type: str api_key: aliases: - password description: - Rackspace API key, overrides O(credentials). type: str check_id: description: - ID of the check that should be alerted on. May be acquired by registering the value of a rax_mon_check task. required: true type: str criteria: description: - Alarm DSL that describes alerting conditions and their output states. Must be between 1 and 16384 characters long. See http://docs.rackspace.com/cm/api/v1.0/cm-devguide/content/alerts-language.html for a reference on the alerting language. type: str disabled: default: false description: - If yes, create this alarm, but leave it in an inactive state. Defaults to no. type: bool metadata: description: - Arbitrary key/value pairs to accompany the alarm. Must be a hash of String keys and values between 1 and 255 characters long. type: dict username: description: - Rackspace username, overrides O(credentials). type: str entity_id: description: - ID of the entity this alarm is attached to. May be acquired by registering the value of a rax_mon_entity task. required: true type: str tenant_id: description: - The tenant ID used for authentication. type: str credentials: aliases: - creds_file description: - File to find the Rackspace credentials in. Ignored if O(api_key) and O(username) are provided. type: path tenant_name: description: - The tenant name used for authentication. type: str auth_endpoint: description: - The URI of the authentication service. - If not specified will be set to U(https://identity.api.rackspacecloud.com/v2.0/). type: str identity_type: default: rackspace description: - Authentication mechanism to use, such as rackspace or keystone. type: str validate_certs: aliases: - verify_ssl description: - Whether or not to require SSL validation of API endpoints. type: bool notification_plan_id: description: - ID of the notification plan to trigger if this alarm fires. May be acquired by registering the value of a rax_mon_notification_plan task. required: true type: str