57

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.

grahamjgreen
  • 1,021

2 Answers2

97

As Hector Valverde mentionned, it seems to be

{{ ansible_hostname|upper }}

...rather than "uppercase"

Pom12
  • 1,086
8

In my case to convert the value of a variable to uppercase pipe the variable to upper like so:

{{ ansible_hostname|upper }}
grahamjgreen
  • 1,021