Skip to content

Commit 5b12bf0

Browse files
committed
docs(roles/uptimerobot): document the shell one-liner form alongside playbook tasks
The role README's "ad-hoc / read-only queries" section only showed the playbook-task form, so the much shorter `ansible localhost -m linuxfabrik.lfops.uptimerobot_account_info` form -- which is what an admin typically wants for quick account / monitor / mwindow / alert-contact / PSP inspection -- was effectively undiscoverable. Adds a list of one-liners covering all four `*_info` modules plus a sample CRUD call (pause monitor), and notes that the harmless `No inventory was parsed` warning is expected in this mode.
1 parent d6945e6 commit 5b12bf0

1 file changed

Lines changed: 28 additions & 2 deletions

File tree

roles/uptimerobot/README.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,38 @@ ansible-playbook --inventory path/to/inventory linuxfabrik.lfops.uptimerobot --t
373373
ansible-playbook --inventory path/to/inventory linuxfabrik.lfops.uptimerobot --check --diff
374374
```
375375

376-
For ad-hoc / read-only queries against UptimeRobot, the modules can be invoked directly without the role:
376+
For ad-hoc / read-only queries against UptimeRobot, the modules can be invoked directly without the role -- either from the shell (one-shot) or from a playbook task. Both forms read the API key from `~/.uptimerobot` by default; pass `api_key_file=...` or `api_key=...` to override.
377+
378+
**Shell one-liners** (no inventory, no playbook -- the module runs against the implicit `localhost`):
379+
380+
```bash
381+
# Account stats: monitor quota, SMS credits, plan / expiry
382+
ansible localhost -m linuxfabrik.lfops.uptimerobot_account_info
383+
384+
# All monitors / one monitor / search prefix
385+
ansible localhost -m linuxfabrik.lfops.uptimerobot_monitor_info
386+
ansible localhost -m linuxfabrik.lfops.uptimerobot_monitor_info \
387+
-a 'friendly_name="001 www.example.com/index.php/login"'
388+
ansible localhost -m linuxfabrik.lfops.uptimerobot_monitor_info -a 'search="001 "'
389+
390+
# Maintenance windows / alert contacts / public status pages
391+
ansible localhost -m linuxfabrik.lfops.uptimerobot_mwindow_info
392+
ansible localhost -m linuxfabrik.lfops.uptimerobot_alert_contact_info
393+
ansible localhost -m linuxfabrik.lfops.uptimerobot_psp_info
394+
395+
# Pause one monitor (a CRUD call -- changed=true on first run, idempotent after)
396+
ansible localhost -m linuxfabrik.lfops.uptimerobot_monitor \
397+
-a 'friendly_name="001 maintenance-mode.example.com" status=paused state=present'
398+
```
399+
400+
The `[WARNING] No inventory was parsed, only implicit localhost is available` line you see in that mode is harmless -- the modules don't need a real inventory.
401+
402+
**Playbook task** (when the result needs to drive a downstream task, run on every host of a group, or chain through `register:` / `assert:`):
377403

378404
```yaml
379405
- name: 'Check UptimeRobot account quota'
380406
linuxfabrik.lfops.uptimerobot_account_info:
381-
register: ur_account
407+
register: 'ur_account'
382408
delegate_to: 'localhost'
383409
384410
- name: 'Pause one monitor'

0 commit comments

Comments
 (0)