Which facts do you use most often?
BeginnerConceptVariables, Facts and Precedence
Answer
ansible_facts['distribution'] # Ubuntu, Rocky
ansible_facts['distribution_version']
ansible_facts['os_family'] # Debian, RedHat
ansible_facts['default_ipv4']['address']
ansible_facts['hostname'] / ['fqdn']
ansible_facts['memtotal_mb']
ansible_facts['processor_vcpus']
ansible_facts['mounts']
ansible_facts['pkg_mgr']
ansible_facts['service_mgr']
Use os_family for package-manager decisions and distribution plus distribution_major_version for version-specific branches.
More on Variables, Facts and Precedence
Where can you define variables in Ansible?BeginnerHow do you reference a variable, and when must you quote it?BeginnerGive a summary of variable precedence.IntermediateWhat are the lowest and highest precedence sources, and why does that matter?IntermediateWhat is the difference between a role's `defaults/` and `vars/`?IntermediateWhat are facts and how are they gathered?Beginner