Linux – Convert value of an Ansible variable from lower case to upper case

ansiblelinux

I am working on a playbook to join linux systems to Active Directory.
I can't seem to find a way to convert the value of ansible_hostname to uppercase. One of the commands I need to run requires the hostname to be supplied in uppercase.

Best Answer

As Hector Valverde mentionned, it seems to be

{{ ansible_hostname|upper }}

...rather than "uppercase"