ansible.builtin.pagerduty (v2.5.11) — module

Create PagerDuty maintenance windows

| "added in version" 1.2 of ansible.builtin"

Authors: Andrew Newdigate (@suprememoocow), Dylan Silva (@thaumos), Justin Johns, Bruce Pennypacker

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.5.11

Description

This module will let you create PagerDuty maintenance windows


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# List ongoing maintenance windows using a user/passwd
- pagerduty:
    name: companyabc
    user: example@example.com
    passwd: password123
    state: ongoing
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# List ongoing maintenance windows using a token
- pagerduty:
    name: companyabc
    token: xxxxxxxxxxxxxx
    state: ongoing
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create a 1 hour maintenance window for service FOO123, using a user/passwd
- pagerduty:
    name: companyabc
    user: example@example.com
    passwd: password123
    state: running
    service: FOO123
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create a 5 minute maintenance window for service FOO123, using a token
- pagerduty:
    name: companyabc
    token: xxxxxxxxxxxxxx
    hours: 0
    minutes: 5
    state: running
    service: FOO123
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.

# Create a 4 hour maintenance window for service FOO123 with the description "deployment".
- pagerduty:
    name: companyabc
    user: example@example.com
    passwd: password123
    state: running
    service: FOO123
    hours: 4
    desc: deployment
  register: pd_window
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Delete the previous maintenance window
- pagerduty:
    name: companyabc
    user: example@example.com
    passwd: password123
    state: absent
    service: '{{ pd_window.result.maintenance_window.id }}'

Inputs

    
desc:
    aliases: []
    choices: []
    default: Created by Ansible
    description:
    - Short description of maintenance window.
    required: false

name:
    aliases: []
    choices: []
    default: null
    description:
    - PagerDuty unique subdomain.
    required: true

user:
    aliases: []
    choices: []
    default: null
    description:
    - PagerDuty user ID.
    required: true

hours:
    aliases: []
    choices: []
    default: 1
    description:
    - Length of maintenance window in hours.
    required: false

state:
    aliases: []
    choices:
    - running
    - started
    - ongoing
    - absent
    default: null
    description:
    - Create a maintenance window or get a list of ongoing windows.
    required: true

token:
    aliases: []
    choices: []
    default: null
    description:
    - A pagerduty token, generated on the pagerduty site. Can be used instead of user/passwd
      combination.
    required: true
    version_added: '1.8'
    version_added_collection: ansible.builtin

passwd:
    aliases: []
    choices: []
    default: null
    description:
    - PagerDuty user password.
    required: true

minutes:
    aliases: []
    choices: []
    default: 0
    description:
    - Maintenance window in minutes (this is added to the hours).
    required: false
    version_added: '1.8'
    version_added_collection: ansible.builtin

service:
    aliases:
    - services
    choices: []
    default: null
    description:
    - A comma separated list of PagerDuty service IDs.
    required: false

requester_id:
    aliases: []
    choices: []
    default: null
    description:
    - ID of user making the request. Only needed when using a token and creating a maintenance_window.
    required: true
    version_added: '1.8'
    version_added_collection: ansible.builtin

validate_certs:
    choices:
    - 'yes'
    - 'no'
    default: 'yes'
    description:
    - If C(no), SSL certificates will not be validated. This should only be used on personally
      controlled sites using self-signed certificates.
    required: false
    version_added: 1.5.1
    version_added_collection: ansible.builtin