community.general.datadog_event (8.5.0) — module

Posts events to Datadog service

Authors: Artūras 'arturaz' Šlajus (@arturaz), Naoya Nakazawa (@n0ts)

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

Allows to post events to Datadog (www.datadoghq.com) service.

Uses http://docs.datadoghq.com/api/#events API.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Post an event with low priority
  community.general.datadog_event:
    title: Testing from ansible
    text: Test
    priority: low
    api_key: 9775a026f1ca7d1c6c5af9d94d9595a4
    app_key: j4JyCYfefWHhgFgiZUqRm63AXHNZQyPGBfJtAzmN
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Post an event with several tags
  community.general.datadog_event:
    title: Testing from ansible
    text: Test
    api_key: 9775a026f1ca7d1c6c5af9d94d9595a4
    app_key: j4JyCYfefWHhgFgiZUqRm63AXHNZQyPGBfJtAzmN
    tags: 'aa,bb,#host:{{ inventory_hostname }}'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Post an event with several tags to another endpoint
  community.general.datadog_event:
    title: Testing from ansible
    text: Test
    api_key: 9775a026f1ca7d1c6c5af9d94d9595a4
    app_key: j4JyCYfefWHhgFgiZUqRm63AXHNZQyPGBfJtAzmN
    api_host: 'https://example.datadoghq.eu'
    tags:
      - aa
      - b
      - '#host:{{ inventory_hostname }}'

Inputs

    
host:
    description:
    - Host name to associate with the event.
    - If not specified, it defaults to the remote system's hostname.
    type: str

tags:
    description:
    - Comma separated list of tags to apply to the event.
    elements: str
    type: list

text:
    description:
    - The body of the event.
    required: true
    type: str

title:
    description:
    - The event title.
    required: true
    type: str

api_key:
    description:
    - Your DataDog API key.
    required: true
    type: str

app_key:
    description:
    - Your DataDog app key.
    required: true
    type: str

api_host:
    description:
    - DataDog API endpoint URL.
    type: str
    version_added: 3.3.0
    version_added_collection: community.general

priority:
    choices:
    - normal
    - low
    default: normal
    description:
    - The priority of the event.
    type: str

alert_type:
    choices:
    - error
    - warning
    - info
    - success
    default: info
    description:
    - Type of alert.
    type: str

date_happened:
    description:
    - POSIX timestamp of the event.
    - Default value is now.
    type: int

validate_certs:
    default: true
    description:
    - If V(false), SSL certificates will not be validated. This should only be used on
      personally controlled sites using self-signed certificates.
    type: bool

aggregation_key:
    description:
    - An arbitrary string to use for aggregation.
    type: str