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 *.json file 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

Terms

list / elements=path / required

The data directory (one path); ~ is expanded.

Examples

- name: Stored snapshots
  ansible.builtin.set_fact:
    stored: "{{ query('ramondevprivate.common.fleet_snapshots', '~/.local/share/fleet-inventory') }}"

Return Value

Key

Description

Return value

list / elements=any

The decoded content of each snapshot file.

Returned: success

Authors

  • Ramon (@RamonDevPrivate)