ramondevprivate.common.fleet_report filter – Merge fleet snapshots into the data for the Markdown pages
Note
This filter plugin is part of the ramondevprivate.common collection (version 1.0.0).
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 ramondevprivate.common.
To use it in a playbook, specify: ramondevprivate.common.fleet_report.
New in ramondevprivate.common 1.0.0
Synopsis
Merges stored snapshots with the snapshots of the current run (current ones win), marks hosts that were targeted but not collected (not reachable, or a task failed), and computes fleet statistics and formatted values.
Snapshots with another schema version are ignored.
Input
This describes the input of the filter, the value before | ramondevprivate.common.fleet_report.
Parameter |
Comments |
|---|---|
Snapshots collected in this run. |
Positional parameters
This describes positional parameters of the filter. These are the values positional1, positional2 and so on in the following
example: input | ramondevprivate.common.fleet_report(positional1, positional2, ...)
Parameter |
Comments |
|---|---|
Snapshots read from the data directory. |
|
Hosts targeted in this run whose snapshot could not be collected. |
|
Settings of the role. Missing keys use the defaults. Unknown keys and invalid values are an error, so a typo can’t silently switch something off. Default: |
|
A last login older than this many days (at collection time) marks a user inactive. Default: |
|
List containers that are not running. If false, only running containers are shown and counted. Choices:
|
|
Auto-updates without a successful run for this many days need attention. Default: |
Examples
- name: Build report
ansible.builtin.set_fact:
report: >-
{{ current | ramondevprivate.common.fleet_report(stored, ansible_play_hosts_all | difference(ansible_play_hosts)) }}
- name: Build report with a stricter auto-update threshold
ansible.builtin.set_fact:
report: >-
{{ current | ramondevprivate.common.fleet_report(stored, [], {'update_max_age_days': 3}) }}
Return Value
Key |
Description |
|---|---|
Input for the overview and the server pages. Returned: success |
|
Needs-attention findings, grouped by host in host order. Returned: success |
|
What the finding is about, e.g. the UFW state, the port, or the account and key fingerprint. Returned: success |
|
Short text of the finding. Returned: success |
|
Inventory name of the host. Returned: success |
|
Rule id. Returned: success Can only return:
|
|
Raw numbers for the Mermaid charts, in host order. Returned: success |
|
Cores per host. Returned: success |
|
Disk capacity per host in GiB, one decimal. Returned: success |
|
Chart height in pixels for horizontal bars, growing with the number of hosts. Returned: success |
|
Host names without the domain labels all hosts share. Returned: success |
|
RAM per host in GiB, one decimal. Returned: success |
|
Number of containers on the pages (without stopped ones if Returned: success |
|
One entry per host, sorted by name, with the formatted values the role’s templates print. Its keys follow the templates and are not a stable interface; the JSON snapshots are. Returned: success |
|
Number of hosts whose exposure is Returned: success |
|
Newest collection date of all snapshots (YYYY-MM-DD); empty without snapshots. Returned: success |
|
Cores, RAM and disk across the fleet. Returned: success |
|
Formatted average; empty without hosts. Returned: success |
|
Returned: success |
|
Formatted largest value; empty without hosts. Returned: success |
|
Formatted smallest value; empty without hosts. Returned: success |
|
Formatted sum (RAM and disk with binary units); empty without hosts. Returned: success |
|
Number of servers per OS major version (Debian 13.1 and 13.3 count as Debian 13), sorted by OS. Returned: success |
|
OS name and major version, for example Returned: success |
|
Number of servers running it. Returned: success |
|
Number of hosts whose exposure is Returned: success |
|
Number of hosts in the report. Returned: success |
|
Totals row of the hardware table. Returned: success |
|
Sum of all cores. Returned: success |
|
Formatted sum of all disk capacity. Returned: success |
|
Formatted sum of all RAM. Returned: success |
|
Number of hosts not collected in this run (not reachable, or a task failed) or marked Returned: success |