linuxfabrik.lfops.uptimerobot_psp¶
Create, update or delete an UptimeRobot Public Status Page
Synopsis¶
- Manages a single UptimeRobot Public Status Page (PSP) end-to-end (create, update, pause/resume, delete) against the v2 API.
- Identification is by friendly_name; the value must be unique on the account. Re-running a task with the same friendly_name updates the existing PSP in place and only reports
changed=truewhen one of the diffable fields actually differs. - monitors is replaced on every run. The list is diffed by sorted monitor IDs, so re-ordering items in the inventory does not produce a spurious change. Omitting monitors (or passing an empty list) leaves the
monitorsfield off the create / edit payload, in which case UptimeRobot applies its own default behaviour for that page. - password cannot be diffed because UptimeRobot never returns it. When supplied, the module always sends it on edit and reports
changed=true. To keep an existing password as is, simply omit password from the task. - status is only honoured on edit; UptimeRobot rejects this field on create.
Available since LFOps 6.0.2.
Mandatory Parameters¶
friendly_name
- Display name of the status page. Used as the idempotency key, so it must be unique on the account.
- Type: String.
Optional Parameters¶
api_key
- UptimeRobot API key. See
uptimerobot_monitorfor the resolution order. - Type: String.
api_key_file
- Path to a file whose first line is the UptimeRobot API key. Tilde-expanded.
- Type: String.
- Default:
~/.uptimerobot
custom_domain
- Custom domain to host the status page under (e.g.
status.example.com). Mutually exclusive with custom_url. - Type: String.
custom_url
- Backward-compatible alias for custom_domain - this is also the field name UptimeRobot uses on the read side. Mutually exclusive with custom_domain.
- Type: String.
hide_url_links
- When
true, the rendered page does not show the underlying monitor URLs. - Type: Bool.
monitors
- Monitors to display on the status page. Each item references an existing monitor. When an item has id, it is used directly. Otherwise friendly_name is resolved against
getMonitors; an unknown name fails the play. - Type: List.
-
Subkeys:
-
friendly_name:- Friendly name of an existing monitor. Required if id is not given.
- Type: String.
-
id:- Numeric monitor ID. Takes precedence over friendly_name when both are set.
- Type: Number.
-
password
- Password to protect the status page. UptimeRobot never returns the stored value, so re-running the task with password set always reports
changed=true. Omit to keep the previous password. - Type: String.
sort
- Sort order of the monitors on the page.
- Type: String. One of
a-z,down-up-paused,up-down-paused,z-a.
state
presentcreates the PSP when missing, or updates it in place when present.absentdeletes it; when the PSP does not exist, the module exits withchanged=false.- Type: String. One of
absent,present. - Default:
present
status
activeun-pauses the page,pausedpauses it. Only honoured on edit; UptimeRobot rejects this field on create.- Type: String. One of
active,paused.
Examples¶
# 1) Create-or-update a public status page. Monitors are referenced by their
# friendly_name; the module resolves them to numeric IDs at runtime.
- name: 'Public status page for example.com'
linuxfabrik.lfops.uptimerobot_psp:
friendly_name: 'Status - example.com'
custom_url: 'status.example.com'
monitors:
- friendly_name: '001 www.example.com/index.php/login'
- friendly_name: '001 office.example.com/hosting/discovery'
sort: 'a-z'
status: 'active'
state: 'present'
# 2) Password-protected page (no `monitors` => the API publishes ALL monitors
# of the account).
- linuxfabrik.lfops.uptimerobot_psp:
friendly_name: 'Internal status'
password: '{{ vault_psp_password }}'
sort: 'down-up-paused'
status: 'active'
state: 'present'
# 3) Pause a status page without changing its content.
- linuxfabrik.lfops.uptimerobot_psp:
friendly_name: 'Status - example.com'
status: 'paused'
state: 'present'
# 4) Delete a stale status page.
- linuxfabrik.lfops.uptimerobot_psp:
friendly_name: 'old-status-page'
state: 'absent'
Return Values¶
debug
- Diagnostic information about the operation (one of
create,update,delete,noop, each optionally suffixed with(check_mode)). Stable enough to assert against, not stable enough to be load-bearing. - Type: Dictionary.
- Returned: always.
-
Sample:
yaml diff_fields: - monitors friendly_name: Status - example.com operation: update psp_id: 4321
psp
- On create or update, the PSP as returned by UptimeRobot's
newPSP/editPSP. On delete, the last known state of the PSP. Empty dict when there was nothing to delete. In check mode, a synthetic preview reflecting what the run would have written. - Type: Dictionary.
- Returned: always.
Authors¶
- Linuxfabrik GmbH, Zurich, Switzerland (info (at) linuxfabrik (dot) ch)