---
  - hosts: all
    gather_facts: true
    tasks:
      - name: mostrar tots el gather facts
        debug:
          var: ansible_facts
      - name: get server hostname
        command: hostname
      - name: mostrar IP del host
        debug:
          msg: "IP: {{ ansible_default_ipv4.address }}"
      - name: mostrar hostname
        debug:
          msg: "Host: {{ ansible_hostname }}"