Skip to content

maintenance

lucasheld edited this page Dec 30, 2022 · 7 revisions

lucasheld.uptime_kuma.maintenance module -- Manages maintenances.

Note

This module is part of the lucasheld.uptime_kuma collection (version 0.4.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install git+https://github.com/lucasheld/ansible-uptime-kuma.git.

To use it in a playbook, specify: lucasheld.uptime_kuma.maintenance.

  • Manages maintenances.

The below requirements are needed on the host that executes this module.

  • uptime-kuma-api

Parameter

Comments

active

boolean

True if the maintenance is active.

Choices:

  • no

  • yes

api_password

string

The Uptime Kuma password.

Only required if no api_token specified and authentication is enabled.

api_token

string

The Uptime Kuma login token.

Only required if no api_username and api_password specified and authentication is enabled.

api_url

string

The Uptime Kuma URL.

Default: "http://127.0.0.1:3001"

api_username

string

The Uptime Kuma username.

Only required if no api_token specified and authentication is enabled.

dateRange

list / elements=string

The date range of the maintenance.

daysOfMonth

list / elements=string

The weekdays of the maintenance.

description

string

The description of the maintenance.

id

integer

The id of the maintenance.

Only required if no title specified.

intervalDay

integer

The interval day of the maintenance.

monitors

list / elements=string

The monitors of the maintenance.

status_pages

list / elements=string

The status pages of the maintenance.

strategy

string

The strategy of the maintenance.

Choices:

  • manual

  • single

  • recurring-interval

  • recurring-weekday

  • recurring-day-of-month

timeRange

list / elements=string

The time range of the maintenance.

title

string

The title of the maintenance.

Only required if no id specified.

weekdays

list / elements=integer

The weekdays of the maintenance.

- name: Add a maintenance
  lucasheld.uptime_kuma.maintenance:
    api_url: http://127.0.0.1:3001
    api_username: admin
    api_password: secret123
    title: maintenance 1
    description: test
    strategy: single
    active: true
    intervalDay: 1
    dateRange:
      - "2022-12-27 22:36:00"
      - "2022-12-29 22:36:00"
    timeRange:
      - hours: 2
        minutes: 0
      - hours: 3
        minutes: 0
    monitors:
      - name: monitor 1
      - name: monitor 2
    status_pages:
      - name: status page 1
      - name: status page 2
    state: present

- name: Edit a maintenance
  lucasheld.uptime_kuma.maintenance:
    api_url: http://127.0.0.1:3001
    api_username: admin
    api_password: secret123
    title: maintenance 1
    description: test
    strategy: recurring-interval
    active: true
    intervalDay: 1
    dateRange:
      - "2022-12-27 22:37:00"
      - "2022-12-29 22:37:00"
    timeRange:
      - hours: 2
        minutes: 0
      - hours: 3
        minutes: 0
    monitors:
      - id: 1
    status_pages:
      - id: 1
    state: present

- name: Remove a maintenance
  lucasheld.uptime_kuma.maintenance:
    api_url: http://127.0.0.1:3001
    api_username: admin
    api_password: secret123
    title: maintenance 1
    state: absent

- name: Pause a maintenance
  lucasheld.uptime_kuma.maintenance:
    api_url: http://127.0.0.1:3001
    api_username: admin
    api_password: secret123
    title: maintenance 1
    state: paused

- name: Resume a maintenance
  lucasheld.uptime_kuma.maintenance:
    api_url: http://127.0.0.1:3001
    api_username: admin
    api_password: secret123
    title: maintenance 1
    state: resumed

Authors

  • Lucas Held (@lucasheld)

Collection links

Issue Tracker Repository (Sources)

Clone this wiki locally