From 9d10a0e9f85e2bed8d9701d27a6b0f3ab1459b39 Mon Sep 17 00:00:00 2001 From: Tor Peeto Date: Wed, 14 Nov 2018 06:47:12 -0800 Subject: [PATCH] pagerduty_updates (#48367) --- lib/ansible/modules/monitoring/pagerduty.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/ansible/modules/monitoring/pagerduty.py b/lib/ansible/modules/monitoring/pagerduty.py index 27c7811a6a9..e13d0b4a391 100644 --- a/lib/ansible/modules/monitoring/pagerduty.py +++ b/lib/ansible/modules/monitoring/pagerduty.py @@ -119,6 +119,20 @@ EXAMPLES = ''' user: example@example.com state: absent window_id: '{{ pd_window.result.maintenance_window.id }}' + +# Delete a maintenance window from a separate playbook than its creation, and if it is the only existing maintenance window. +- pagerduty: + requester_id: XXXXXXX + token: yourtoken + state: ongoing + register: pd_window + +- pagerduty: + requester_id: XXXXXXX + token: yourtoken + state: absent + window_id: "{{ pd_window.result.maintenance_windows[0].id }}" + ''' import datetime