It will depend on your environment and setup what is available and can be collected.
You could just have a short test with
---
- hosts: localhost
become: false
gather_facts: true
gather_subset:
- "min"
tasks:
- name: Show Gathered Facts
debug:
msg: "{{ ansible_facts }}"
and check the output, in example for a RHEL system the keys are
_ansible_facts_gathered: true
ansible_apparmor:
status:
ansible_architecture:
ansible_cmdline:
BOOT_IMAGE:
LANG:
elevator:
quiet:
rhgb:
ro:
root:
ansible_date_time:
date: ''
day: ''
epoch: ''
hour:
iso8601: ''
iso8601_basic:
iso8601_basic_short:
iso8601_micro: ''
minute: ''
month: ''
second: ''
time:
tz:
tz_offset: ''
weekday:
weekday_number: ''
weeknumber: ''
year: ''
ansible_distribution:
ansible_distribution_file_parsed:
ansible_distribution_file_path:
ansible_distribution_file_search_string:
ansible_distribution_file_variety:
ansible_distribution_major_version: ''
ansible_distribution_release:
ansible_distribution_version: ''
ansible_dns:
nameservers:
-
search:
-
ansible_domain:
ansible_effective_group_id:
ansible_effective_user_id:
ansible_env:
HISTCONTROL:
HISTSIZE: ''
HOME:
HOSTNAME:
KRB5CCNAME:
LANG:
LESSOPEN: ''
LOGNAME:
LS_COLORS:
MAIL:
PATH:
PWD:
SELINUX_LEVEL_REQUESTED: ''
SELINUX_ROLE_REQUESTED: ''
SELINUX_USE_CURRENT_RANGE: ''
SHELL:
SHLVL: ''
SSH_CLIENT:
SSH_CONNECTION:
SSH_TTY:
TERM:
TZ:
USER:
XDG_RUNTIME_DIR:
XDG_SESSION_ID: ''
_:
ansible_fips:
ansible_fqdn:
ansible_hostname:
ansible_kernel:
ansible_kernel_version: ''
ansible_local: {}
ansible_lsb: {}
ansible_machine:
ansible_machine_id:
ansible_nodename:
ansible_os_family:
ansible_pkg_mgr:
ansible_proc_cmdline:
BOOT_IMAGE:
LANG:
elevator:
quiet:
rhgb:
ro:
root:
ansible_python:
executable:
has_sslcontext:
type:
version:
major:
micro:
minor:
releaselevel:
serial:
version_info:
-
ansible_python_version:
ansible_real_group_id:
ansible_real_user_id:
ansible_selinux:
config_mode:
mode:
policyvers:
status:
type:
ansible_selinux_python_present:
ansible_service_mgr:
ansible_ssh_host_key_ecdsa_public:
ansible_ssh_host_key_ed25519_public:
ansible_ssh_host_key_rsa_public:
ansible_system:
ansible_system_capabilities:
- ''
ansible_system_capabilities_enforced: ''
ansible_user_dir:
ansible_user_gecos:
ansible_user_gid:
ansible_user_id:
ansible_user_shell:
ansible_user_uid:
ansible_userspace_architecture:
ansible_userspace_bits: ''
gather_subset:
- min
module_setup: true
For min
the /ansible/modules/setup.py tries to gather information from
minimal_gather_subset = frozenset(['apparmor', 'caps', 'cmdline', 'date_time',
'distribution', 'dns', 'env', 'fips', 'local',
'lsb', 'pkg_mgr', 'platform', 'python', 'selinux',
'service_mgr', 'ssh_pub_keys', 'user'])
so that can be considered as
the exact list of fact that min
subset would collect.
As one can see, blocks of the information are coming from different modules, in example for ansible_distribution
from facts/system/distribution.py.
In my case in example, the module for ansible_env
, facts/system/env.py will create keys which can not be found in any other environment.
For more background information of what is collected for specific environments and setups you have a look into /ansible/module_utils/facts.
Further Q&A