grafana.grafana.alert_contact_point module – Manage Alerting Contact points in Grafana

Note

This module is part of the grafana.grafana collection (version 2.2.5).

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 grafana.grafana. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: grafana.grafana.alert_contact_point.

New in grafana.grafana 0.0.1

Synopsis

  • Create, Update and delete Contact points using Ansible.

Requirements

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

  • requests >= 1.0.0

Parameters

Parameter

Comments

disableResolveMessage

boolean

When set to true, Disables the resolve message [OK] that is sent when alerting state returns to false.

Choices:

  • false ← (default)

  • true

grafana_api_key

string / required

Grafana API Key used to authenticate with Grafana.

grafana_url

string / required

URL of the Grafana instance.

name

string / required

Sets the name of the contact point.

settings

dictionary / required

Sets Contact point settings.

state

string

State for the Grafana Alert Contact Point.

Choices:

  • "present" ← (default)

  • "absent"

type

string / required

Sets Contact point type.

uid

string / required

Sets the UID of the Contact point.

Notes

Note

  • Does not support check_mode.

Examples

- name: Create/Update Alerting contact point
  grafana.grafana.alert_contact_point:
    name: ops-email
    uid: opsemail
    type: email
    settings:
      addresses: "[email protected],[email protected]"
    grafana_url: "{{ grafana_url }}"
    grafana_api_key: "{{ grafana_api_key }}"
    state: present

- name: Delete Alerting contact point
  grafana.grafana.alert_contact_point:
    name: ops-email
    uid: opsemail
    type: email
    settings:
      addresses: "[email protected],[email protected]"
    grafana_url: "{{ grafana_url }}"
    grafana_api_key: "{{ grafana_api_key }}"
    state: absent

Return Values

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

Key

Description

output

dictionary

Dict object containing Contact point information information.

Returned: On success

disableResolveMessage

boolean

When set to True, Disables the resolve message [OK] that is sent when alerting state returns to false.

Returned: state is present and on success

Sample: false

name

string

The name for the contact point.

Returned: state is present and on success

Sample: "ops-email"

settings

dictionary

Contains contact point settings.

Returned: state is present and on success

Sample: {"addresses": "ops@mydomain.com,devs@mydomain.com"}

type

string

The type of contact point.

Returned: state is present and on success

Sample: "email"

uid

string

The UID for the contact point.

Returned: state is present and on success

Sample: "opsemail"

Authors

  • Ishan Jain (@ishanjainn)