community.general.pagerduty – Create PagerDuty maintenance windows¶
Note
This plugin is part of the community.general collection (version 2.5.1).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.pagerduty
.
Requirements¶
The below requirements are needed on the host that executes this module.
PagerDuty API access
Parameters¶
Examples¶
- name: List ongoing maintenance windows using a token
community.general.pagerduty:
name: companyabc
token: xxxxxxxxxxxxxx
state: ongoing
- name: Create a 1 hour maintenance window for service FOO123
community.general.pagerduty:
name: companyabc
user: [email protected]
token: yourtoken
state: running
service: FOO123
- name: Create a 5 minute maintenance window for service FOO123
community.general.pagerduty:
name: companyabc
token: xxxxxxxxxxxxxx
hours: 0
minutes: 5
state: running
service: FOO123
- name: Create a 4 hour maintenance window for service FOO123 with the description "deployment"
community.general.pagerduty:
name: companyabc
user: [email protected]
state: running
service: FOO123
hours: 4
desc: deployment
register: pd_window
- name: Delete the previous maintenance window
community.general.pagerduty:
name: companyabc
user: [email protected]
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
- name: Check
community.general.pagerduty:
requester_id: XXXXXXX
token: yourtoken
state: ongoing
register: pd_window
- name: Delete
community.general.pagerduty:
requester_id: XXXXXXX
token: yourtoken
state: absent
window_id: "{{ pd_window.result.maintenance_windows[0].id }}"
Authors¶
Andrew Newdigate (@suprememoocow)
Dylan Silva (@thaumos)
Justin Johns (!UNKNOWN)
Bruce Pennypacker (@bpennypacker)