community.general.alerta_customer (8.5.0) — module

Manage customers in Alerta

| "added in version" 4.8.0 of community.general"

Authors: Christian Wollinger (@cwollinger)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Create or delete customers in Alerta with the REST API.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create customer
  community.general.alerta_customer:
    alerta_url: https://alerta.example.com
    api_username: admin@example.com
    api_password: password
    customer: Developer
    match: dev@example.com
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete customer
  community.general.alerta_customer:
    alerta_url: https://alerta.example.com
    api_username: admin@example.com
    api_password: password
    customer: Developer
    match: dev@example.com
    state: absent

Inputs

    
match:
    description:
    - The matching logged in user for the customer.
    required: true
    type: str

state:
    choices:
    - absent
    - present
    default: present
    description:
    - Whether the customer should exist or not.
    - Both O(customer) and O(match) identify a customer that should be added or removed.
    type: str

api_key:
    description:
    - The access token for the API.
    type: str

customer:
    description:
    - Name of the customer.
    required: true
    type: str

alerta_url:
    description:
    - The Alerta API endpoint.
    required: true
    type: str

api_password:
    description:
    - The password for the API using basic auth.
    type: str

api_username:
    description:
    - The username for the API using basic auth.
    type: str

Outputs

msg:
  description:
  - Success or failure message.
  returned: always
  sample: Customer customer1 created
  type: str
response:
  description:
  - The response from the API.
  returned: always
  type: dict

See also