- name: Gather facts from host and print all variables hosts: all gather_facts: yes tasks: - name: Print all variables debug: var: vars - name: Print variable value debug: msg: "Variable: {{ ansible_fqdn }}"