ramondevprivate.common.fleet_exposure filter – Exposure per host from the ping results of the probe host

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_exposure.

New in ramondevprivate.common 1.0.0

Synopsis

  • public if any public address answered, internal if none answered or the host has no public address.

  • If a ping could not be sent (probe host unreachable, no IPv6 there, no probe in this run) and nothing answered, the host keeps the exposure of its stored snapshot, or is unknown.

Input

This describes the input of the filter, the value before | ramondevprivate.common.fleet_exposure.

Parameter

Comments

Input

list / elements=dictionary / required

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_exposure(positional1, positional2, ...)

Parameter

Comments

results

list / elements=dictionary / required

The registered results of the ping loop over the fleet_probe_targets entries.

Empty if no probe ran.

stored

list / elements=dictionary / required

Snapshots read from the data directory.

Examples

- name: Exposure per host
  ansible.builtin.set_fact:
    exposures: "{{ current | ramondevprivate.common.fleet_exposure(pings.results | default([]), stored) }}"

Return Value

Key

Description

Return value

dictionary

Mapping of host name to state, checked_at and answered.

Returned: success

Authors

  • Ramon (@RamonDevPrivate)