- name: Gather facts from host
hosts: all
gather_facts: yes
tasks:
- name: Print all available facts
debug:
var: ansible_facts
- name: Print variable value
msg: "Variable: {{ ansible_fqdn }}"