community.general.alerta_customer module – Manage customers in Alerta

Note

This module is part of the community.general collection (version 10.0.1).

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 community.general.

To use it in a playbook, specify: community.general.alerta_customer.

New in community.general 4.8.0

Synopsis

  • Create or delete customers in Alerta with the REST API.

Parameters

Parameter

Comments

alerta_url

string / required

The Alerta API endpoint.

api_key

string

The access token for the API.

api_password

string

The password for the API using basic auth.

api_username

string

The username for the API using basic auth.

customer

string / required

Name of the customer.

match

string / required

The matching logged in user for the customer.

state

string

Whether the customer should exist or not.

Both customer and match identify a customer that should be added or removed.

Choices:

  • "absent"

  • "present" ← (default)

Attributes

Attribute

Support

Description

check_mode

Support: full

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: none

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

See Also

See also

API documentation

Documentation for Alerta API

Examples

- name: Create customer
  community.general.alerta_customer:
    alerta_url: https://alerta.example.com
    api_username: [email protected]
    api_password: password
    customer: Developer
    match: [email protected]

- name: Delete customer
  community.general.alerta_customer:
    alerta_url: https://alerta.example.com
    api_username: [email protected]
    api_password: password
    customer: Developer
    match: [email protected]
    state: absent

Return Values

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

Key

Description

msg

string

Success or failure message.

Returned: always

Sample: "Customer customer1 created"

response

dictionary

The response from the API.

Returned: always

Authors

  • Christian Wollinger (@cwollinger)