From 9f932196116165dc898d9a37dce398dc4590671b Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Fri, 23 Oct 2020 07:48:41 +0200 Subject: [PATCH] Add include_tags to datadog_monitor (#409) (#1158) * Add include_tags to datadog_monitor * Incorporate PR feedback * Add changelog fragment * Update changelogs/fragments/409-datadog-monitor-include-tags.yaml Co-authored-by: Andrew Klychkov * Update plugins/modules/monitoring/datadog/datadog_monitor.py Co-authored-by: Felix Fontein Co-authored-by: Andrew Klychkov Co-authored-by: Felix Fontein (cherry picked from commit 307c54750f238ddf6abeebb514612a9fb28acb95) Co-authored-by: Ty Martin --- .../fragments/409-datadog-monitor-include-tags.yaml | 2 ++ .../modules/monitoring/datadog/datadog_monitor.py | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/409-datadog-monitor-include-tags.yaml diff --git a/changelogs/fragments/409-datadog-monitor-include-tags.yaml b/changelogs/fragments/409-datadog-monitor-include-tags.yaml new file mode 100644 index 0000000000..1c1ece6454 --- /dev/null +++ b/changelogs/fragments/409-datadog-monitor-include-tags.yaml @@ -0,0 +1,2 @@ +minor_changes: + - datadog_monitor - add ``include_tags`` option (https://github.com/ansible/ansible/issues/57441). diff --git a/plugins/modules/monitoring/datadog/datadog_monitor.py b/plugins/modules/monitoring/datadog/datadog_monitor.py index 008b305f88..cccc0343d1 100644 --- a/plugins/modules/monitoring/datadog/datadog_monitor.py +++ b/plugins/modules/monitoring/datadog/datadog_monitor.py @@ -135,6 +135,12 @@ options: - The ID of the alert. - If set, will be used instead of the name to locate the alert. type: str + include_tags: + description: + - Whether notifications from this monitor automatically inserts its triggering tags into the title. + type: bool + default: yes + version_added: 1.3.0 ''' EXAMPLES = ''' @@ -219,7 +225,8 @@ def main(): require_full_window=dict(required=False, default=None, type='bool'), new_host_delay=dict(required=False, default=None), evaluation_delay=dict(required=False, default=None), - id=dict(required=False) + id=dict(required=False), + include_tags=dict(required=False, default=True, type='bool'), ) ) @@ -333,7 +340,8 @@ def install_monitor(module): "locked": module.boolean(module.params['locked']), "require_full_window": module.params['require_full_window'], "new_host_delay": module.params['new_host_delay'], - "evaluation_delay": module.params['evaluation_delay'] + "evaluation_delay": module.params['evaluation_delay'], + "include_tags": module.params['include_tags'], } if module.params['type'] == "service check":