ramondevprivate.common.fleet_info module – Collect read-only server facts for the fleet inventory
Note
This module 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_info.
New in ramondevprivate.common 1.0.0
Synopsis
Collects how a Debian server is set up, for the
ramondevprivate.common.fleet_inventoryrole. Never changes anything on the target; check mode is fully supported.Collected: login accounts with their groups, sudo level and authorized keys; sshd key settings; UFW status and rules; listening sockets; Docker daemons and containers; fail2ban; unattended upgrades.
Needs root (
become) for sshd settings, other users’ key files and sudo rules, UFW, socket processes, Docker sockets and fail2ban jails; without root those parts are reported as unknown and one warning is shown.Never returned are key material, the content of forced commands, password hashes, and container environment variables, commands or labels other than the image version and compose directory.
How each part is read (sources, permission and socket checks) is described in the role README.
Parameters
Parameter |
Comments |
|---|---|
Supplementary groups that are not reported because every desktop-style account has them. Groups like Default: |
|
Accounts that are not collected at all, e.g. provider or image default accounts. Filtering Default: |
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full |
Can run in check_mode and return changed status prediction without modifying target, if not supported the action will be skipped. |
|
Support: none |
Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode |
|
Platform: debian |
Target OS/families that can be operated against |
Examples
- name: Collect fleet info
ramondevprivate.common.fleet_info:
register: fleet_inventory_info
- name: Collect fleet info, also hiding the lpadmin group and the image's default account
ramondevprivate.common.fleet_info:
group_filter: [cdrom, floppy, audio, dip, video, plugdev, users, netdev, bluetooth, lpadmin]
user_filter: [debian]
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Facts about the host. Null values mean unknown (not readable, tool missing or no root). Returned: always |
|
Unattended-upgrades configuration and last successful run; null values are unknown. Returned: always |
|
Whether the Returned: success |
|
Last successful Returned: success |
|
Returned: success |
|
Returned: success |
|
Returned: success |
|
Docker daemons found by their sockets, with their containers. Returned: always |
|
All containers of the daemon, running or not. Returned: success |
|
Compose working directory label; empty if not started by compose. Returned: success |
|
Image reference as configured, for example Returned: success |
|
Container name. Returned: success |
|
Published ports; empty for a stopped container. Returned: success |
|
Port in the container. Returned: success |
|
Host address. Returned: success |
|
Port on the host. Returned: success |
|
Returned: success |
|
Container state, for example Returned: success |
|
The Returned: success |
|
Returned: success Can only return:
|
|
Account that runs a rootless daemon; empty for the rootful one. Returned: success |
|
Path of the daemon’s socket. Returned: success |
|
Returned: success Can only return:
|
|
Engine version; empty if the daemon was not queried or did not answer. Returned: success |
|
fail2ban service state and jails. Returned: always |
|
Jail names; null if unknown (not running, no root). Returned: success |
|
Returned: success |
|
Listening TCP and bound UDP sockets from Returned: always |
|
Bind address without brackets; Returned: success |
|
Interface from Returned: success |
|
Port number. Returned: success |
|
Names of the processes holding the socket; empty without root. Returned: success |
|
Returned: success |
|
Version of the result format. Returned: always |
|
Where sshd looks for authorized keys. Returned: always |
|
Returned: success |
|
Returned: success Can only return:
|
|
Whether an Returned: success |
|
UFW status, default policies and rules. Returned: always |
|
Incoming default ( Returned: success |
|
Default outgoing policy, like Returned: success |
|
Default routed policy, like Returned: success |
|
Logging, for example Returned: success |
|
Rules added with ufw; null if the rule files are not readable. Returned: success |
|
Returned: success |
|
Destination-side application profile; its ports are already in Returned: success |
|
Rule comment, decoded. Returned: success |
|
Returned: success |
|
Address family of the rule set the rule comes from. Returned: success Can only return:
|
|
Source network, like Returned: success |
|
Source port, like Returned: success |
|
Incoming interface; empty if not limited to one. Returned: success |
|
Outgoing interface; empty if not limited to one. Returned: success |
|
Returned: success |
|
Whether it is a Returned: success |
|
Destination network, Returned: success |
|
Destination port, list ( Returned: success |
|
UFW state. Returned: success Can only return:
|
|
Root, accounts with a login shell and Returned: always |
|
Keys from the files sshd uses, without the key material; null if a key file is not readable. Returned: success |
|
The Returned: success |
|
Key comment; empty if the key has none. Returned: success |
|
SHA256 fingerprint as shown by Returned: success |
|
Whether the key has a Returned: success |
|
Key type, for example Returned: success |
|
Supplementary groups without the primary group and without Returned: success |
|
Last login (ISO 8601); empty if there is no record, null if Returned: success |
|
Account name. Returned: success |
|
What the account may run, from Returned: success |
|
Returned: success Can only return:
|
|
Whether a rule that makes up the level (the full ones, if any) has Returned: success |
|
The rules Returned: success |
|
Numeric user id. Returned: success |