You can just use {{ ansible_ssh_host }}
Inventory:
[my_hosts]
my_host ansible_ssh_host=127.0.0.1 my_host_alias=my_host
Playbook:
---
- name: Example
  user: ubuntu
  hosts: all
  tasks:
    - name: whatever
      debug: msg="Myhost is {{ ansible_ssh_host }}"
    - name: whatever
      debug: msg="My host alias is {{ my_host_alias }}"