Split a variable?

Hi all,

I’m searching how to split a variable with ansible.
For example on my playbook I got the variable {{install[‘myhostname’]}}.
Actually this viarable is hostname.domain.

How can I split it to 2 variables, hostname and domain ?

Thanks !

https://blog.billyc.io/2017/02/12/ansible-snippets---splitting-variables/