From b99586e26a8318aeafbcd520384b3093278f4fba Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Wed, 25 Nov 2020 08:01:17 +0100 Subject: [PATCH] Datadog: Mark notification_message as no_log (#1338) (#1385) * Datadog: Mark notification_message as no_log This message field is often used to page people or teams inside an organization when a monitor goes off, by using `@` mentions. If Ansible is configured to use Datadog's callback plugin [1], an unwanted interaction would happen: When a monitor fails to create, the callback sends an error event to Datadog which contains all the task's loggable fields in it. If the message field contains `@` mentions, this event would page the people on them. [1] https://github.com/DataDog/ansible-datadog-callback * Add changelog fragment * Update changelogs/fragments/1338-datadog-mark-notification_message-no_log.yml Co-authored-by: Felix Fontein Co-authored-by: Felix Fontein (cherry picked from commit e73451f09e939d4e16217cde605e1657bf8a9702) Co-authored-by: Albert Vaca Cintora --- .../1338-datadog-mark-notification_message-no_log.yml | 3 +++ plugins/modules/monitoring/datadog/datadog_monitor.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/1338-datadog-mark-notification_message-no_log.yml diff --git a/changelogs/fragments/1338-datadog-mark-notification_message-no_log.yml b/changelogs/fragments/1338-datadog-mark-notification_message-no_log.yml new file mode 100644 index 0000000000..49c036c3ac --- /dev/null +++ b/changelogs/fragments/1338-datadog-mark-notification_message-no_log.yml @@ -0,0 +1,3 @@ +--- +minor_changes: + - datadog - mark ``notification_message`` as ``no_log`` (https://github.com/ansible-collections/community.general/pull/1338). diff --git a/plugins/modules/monitoring/datadog/datadog_monitor.py b/plugins/modules/monitoring/datadog/datadog_monitor.py index dc76cca259..f6020c2bed 100644 --- a/plugins/modules/monitoring/datadog/datadog_monitor.py +++ b/plugins/modules/monitoring/datadog/datadog_monitor.py @@ -211,7 +211,7 @@ def main(): type=dict(required=False, choices=['metric alert', 'service check', 'event alert', 'process alert', 'log alert']), name=dict(required=True), query=dict(required=False), - notification_message=dict(required=False, default=None, aliases=['message'], + notification_message=dict(required=False, no_log=True, default=None, aliases=['message'], deprecated_aliases=[dict(name='message', version='3.0.0', collection_name='community.general')]), # was Ansible 2.14 silenced=dict(required=False, default=None, type='dict'),