community.general.datadog_downtime – Manages Datadog downtimes¶
Note
This plugin is part of the community.general collection (version 2.5.1).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.datadog_downtime
.
New in version 2.0.0: of community.general
Synopsis¶
Manages downtimes within Datadog.
Options as described on https://docs.datadoghq.com/api/v1/downtimes/s.
Requirements¶
The below requirements are needed on the host that executes this module.
datadog-api-client
Python 3.6+
Parameters¶
Examples¶
- name: Create a downtime
register: downtime_var
community.general.datadog_downtime:
state: present
monitor_tags:
- "foo:bar"
downtime_message: "Downtime for foo:bar"
scope: "test"
api_key: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
app_key: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
# Lookup the id in the file and ignore errors if the file doesn't exits, so downtime gets created
id: "{{ lookup('file', inventory_hostname ~ '_downtime_id.txt', errors='ignore') }}"
- name: Save downtime id to file for later updates and idempotence
delegate_to: localhost
copy:
content: "{{ downtime.downtime.id }}"
dest: "{{ inventory_hostname ~ '_downtime_id.txt' }}"
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Datadog (@Datadog)