We need to set /etc/hostname and /etc/mailname to the {{ inventory_hostname }}.
/etc/hostname
/etc/mailname
{{ inventory_hostname }}