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

Note

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

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.

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

New in version 0.0.1: of grafana.grafana

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:

  • no ← (default)

  • yes

grafana_api_key

string / required

Grafana API Key used to authenticate with Grafana.

name

string / required

Name of the contact point

settings

dictionary / required

Contact point settings

stack_slug

string / required

Name of the Grafana Cloud stack to which the contact points will be added

state

string

State for the Grafana CLoud stack.

Choices:

  • present ← (default)

  • absent

type

string / required

Contact point type

uid

string / required

Sets the UID of the Contact point.

Examples

- name: Create/Update Alerting contact point
  grafana.grafana.alert_contact_point:
    name: ops-email
    uid: opsemail
    type: email
    settings: {
       addresses: "ops@mydomain.com,devs@mydomain.com"
     }
    stack_slug: "{{ stack_slug }}"
    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: "ops@mydomain.com,devs@mydomain.com"
     }
    stack_slug: "{{ stack_slug }}"
    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

name

string

The name for the contact point

Returned: state is present and on success

settings

dictionary

Contains contact point settings

Returned: state is present and on success

type

string

The type of contact point

Returned: state is present and on success

uid

string

The UID for the contact point

Returned: state is present and on success

Authors

  • Ishan Jain (@ishanjainn)