ramondevprivate.common.fleet_snapshots lookup – Read the stored fleet_inventory snapshots
Note
This lookup 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_snapshots.
New in ramondevprivate.common 1.0.0
Synopsis
Reads every
*.jsonfile in the data directory on the controller and returns the decoded snapshots, in file name order.A directory that doesn’t exist yet gives an empty list (first run, also in check mode).
A file that can’t be read or isn’t valid JSON fails with its path. Whether a decoded value is a valid snapshot is decided by the ramondevprivate.common.fleet_report filter, which ignores invalid ones.
Terms
Parameter |
Comments |
|---|---|
The data directory (one path); |
Examples
- name: Stored snapshots
ansible.builtin.set_fact:
stored: "{{ query('ramondevprivate.common.fleet_snapshots', '~/.local/share/fleet-inventory') }}"
Return Value
Key |
Description |
|---|---|
The decoded content of each snapshot file. Returned: success |