pagerduty – Create PagerDuty maintenance windows¶
Synopsis¶
This module will let you create PagerDuty maintenance windows
Requirements¶
The below requirements are needed on the host that executes this module.
PagerDuty API access
Parameters¶
Examples¶
# List ongoing maintenance windows using a token
- pagerduty:
name: companyabc
token: xxxxxxxxxxxxxx
state: ongoing
# Create a 1 hour maintenance window for service FOO123
- pagerduty:
name: companyabc
user: example@example.com
token: yourtoken
state: running
service: FOO123
# Create a 5 minute maintenance window for service FOO123
- pagerduty:
name: companyabc
token: xxxxxxxxxxxxxx
hours: 0
minutes: 5
state: running
service: FOO123
# Create a 4 hour maintenance window for service FOO123 with the description "deployment".
- pagerduty:
name: companyabc
user: example@example.com
state: running
service: FOO123
hours: 4
desc: deployment
register: pd_window
# Delete the previous maintenance window
- pagerduty:
name: companyabc
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 }}"
Status¶
This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by the Ansible Community. [community]