From 3eadb9d637cb60b04aed18f5a9f5bf750a3d8e62 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 9 Feb 2021 15:42:39 +0100 Subject: [PATCH] Revert "Revert new features since the 2.0.0 release so we can release 2.0.1 from this branch." This reverts commit 1d90e91528ee741ef9baaac98b9334942b7c3d0e. --- changelogs/fragments/1702_homebrew_tap.yml | 2 ++ ...adog_monitor-add-missing-monitor-types.yml | 2 ++ .../monitoring/datadog/datadog_monitor.py | 9 +++++--- plugins/modules/packaging/os/homebrew_tap.py | 21 ++++++++++++++++--- 4 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 changelogs/fragments/1702_homebrew_tap.yml create mode 100644 changelogs/fragments/1723-datadog_monitor-add-missing-monitor-types.yml diff --git a/changelogs/fragments/1702_homebrew_tap.yml b/changelogs/fragments/1702_homebrew_tap.yml new file mode 100644 index 0000000000..7eabc45a9b --- /dev/null +++ b/changelogs/fragments/1702_homebrew_tap.yml @@ -0,0 +1,2 @@ +minor_changes: +- homebrew_tap - add support to specify search path for ``brew`` executable (https://github.com/ansible-collections/community.general/issues/1702). diff --git a/changelogs/fragments/1723-datadog_monitor-add-missing-monitor-types.yml b/changelogs/fragments/1723-datadog_monitor-add-missing-monitor-types.yml new file mode 100644 index 0000000000..8b01717897 --- /dev/null +++ b/changelogs/fragments/1723-datadog_monitor-add-missing-monitor-types.yml @@ -0,0 +1,2 @@ +minor_changes: + - datadog_monitor - add missing monitor types ``query alert``, ``trace-analytics alert``, ``rum alert`` (https://github.com/ansible-collections/community.general/pull/1723). diff --git a/plugins/modules/monitoring/datadog/datadog_monitor.py b/plugins/modules/monitoring/datadog/datadog_monitor.py index f6020c2bed..f63c66a57d 100644 --- a/plugins/modules/monitoring/datadog/datadog_monitor.py +++ b/plugins/modules/monitoring/datadog/datadog_monitor.py @@ -49,7 +49,8 @@ options: type: description: - The type of the monitor. - choices: ['metric alert', 'service check', 'event alert', 'process alert', 'log alert'] + - The types C(query alert), C(trace-analytics alert) and C(rum alert) were added in community.general 2.1.0. + choices: ['metric alert', 'service check', 'event alert', 'process alert', 'log alert', 'query alert', 'trace-analytics alert', 'rum alert'] type: str query: description: @@ -208,7 +209,9 @@ def main(): api_host=dict(required=False), app_key=dict(required=True, no_log=True), state=dict(required=True, choices=['present', 'absent', 'mute', 'unmute']), - type=dict(required=False, choices=['metric alert', 'service check', 'event alert', 'process alert', 'log alert']), + type=dict(required=False, choices=['metric alert', 'service check', 'event alert', + 'process alert', 'log alert', 'query alert', + 'trace-analytics alert', 'rum alert']), name=dict(required=True), query=dict(required=False), notification_message=dict(required=False, no_log=True, default=None, aliases=['message'], @@ -348,7 +351,7 @@ def install_monitor(module): if module.params['type'] == "service check": options["thresholds"] = module.params['thresholds'] or {'ok': 1, 'critical': 1, 'warning': 1} - if module.params['type'] in ["metric alert", "log alert"] and module.params['thresholds'] is not None: + if module.params['type'] in ["metric alert", "log alert", "query alert", "trace-analytics alert", "rum alert"] and module.params['thresholds'] is not None: options["thresholds"] = module.params['thresholds'] monitor = _get_monitor(module) diff --git a/plugins/modules/packaging/os/homebrew_tap.py b/plugins/modules/packaging/os/homebrew_tap.py index 99cff69b00..6b30fdb68f 100644 --- a/plugins/modules/packaging/os/homebrew_tap.py +++ b/plugins/modules/packaging/os/homebrew_tap.py @@ -45,6 +45,12 @@ options: required: false default: 'present' type: str + path: + description: + - "A ':' separated list of paths to search for C(brew) executable." + default: '/usr/local/bin:/opt/homebrew/bin' + type: path + version_added: '2.1.0' requirements: [ homebrew ] ''' @@ -127,7 +133,7 @@ def add_tap(module, brew_path, tap, url=None): def add_taps(module, brew_path, taps): '''Adds one or more taps.''' - failed, unchanged, added, msg = False, 0, 0, '' + failed, changed, unchanged, added, msg = False, False, 0, 0, '' for tap in taps: (failed, changed, msg) = add_tap(module, brew_path, tap) @@ -182,7 +188,7 @@ def remove_tap(module, brew_path, tap): def remove_taps(module, brew_path, taps): '''Removes one or more taps.''' - failed, unchanged, removed, msg = False, 0, 0, '' + failed, changed, unchanged, removed, msg = False, False, 0, 0, '' for tap in taps: (failed, changed, msg) = remove_tap(module, brew_path, tap) @@ -211,14 +217,23 @@ def main(): name=dict(aliases=['tap'], type='list', required=True, elements='str'), url=dict(default=None, required=False), state=dict(default='present', choices=['present', 'absent']), + path=dict( + default="/usr/local/bin:/opt/homebrew/bin", + required=False, + type='path', + ), ), supports_check_mode=True, ) + path = module.params['path'] + if path: + path = path.split(':') + brew_path = module.get_bin_path( 'brew', required=True, - opt_dirs=['/usr/local/bin', '/opt/homebrew/bin'] + opt_dirs=path, ) taps = module.params['name']