Ansible use inventory_hostname or ansible_hostname in task name
Starting from v2.0 Ansible supports variable substitution in task/handler names: https://github.com/ansible/ansible/issues/10347, so these examples will work as expected:
- name: upgrade software on {{inventory_hostname}}
- name: current host is {{ansible_hostname}}