From 16073f5b08981ae4521bad9400c2e23e765e280a Mon Sep 17 00:00:00 2001 From: David Moreau-Simard Date: Mon, 1 May 2017 21:20:50 -0400 Subject: [PATCH] Add the 'ttl' parameter for sensu_check The TTL [1] parameter for checks allows Sensu to detect if a check has gotten stale (i.e, stopped checking). [1]: https://sensuapp.org/docs/latest/reference/checks.html#check-attributes --- lib/ansible/modules/monitoring/sensu_check.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/ansible/modules/monitoring/sensu_check.py b/lib/ansible/modules/monitoring/sensu_check.py index 8606bb6070a..e674a01d1e3 100644 --- a/lib/ansible/modules/monitoring/sensu_check.py +++ b/lib/ansible/modules/monitoring/sensu_check.py @@ -85,6 +85,12 @@ options: - Timeout for the check required: false default: 10 + ttl: + description: + - Time to live in seconds until the check is considered stale + required: false + default: null + version_added: 2.4 handle: description: - Whether the check should be handled or not @@ -263,6 +269,7 @@ def sensu_check(module, path, name, state='present', backup=False): 'subscribers', 'interval', 'timeout', + 'ttl', 'handle', 'dependencies', 'standalone', @@ -363,6 +370,7 @@ def main(): 'subscribers': {'type': 'list'}, 'interval': {'type': 'int'}, 'timeout': {'type': 'int'}, + 'ttl': {'type': 'int'}, 'handle': {'type': 'bool'}, 'subdue_begin': {'type': 'str'}, 'subdue_end': {'type': 'str'},