- hosts: all tasks: - name: Print IPv4 addresse and hostname for all hosts debug: msg: '{{ ansible_default_ipv4.address }} - {{ ansible_hostname }}'