- hosts: localhost gather_facts: yes tasks: - name: Show the local hostname ansible.builtin.debug: msg: "The hostname of this machine is {{ ansible_hostname }}"