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.
Asked
Active
Viewed 1.7e+01k times
2 Answers
97
As Hector Valverde mentionned, it seems to be
{{ ansible_hostname|upper }}
...rather than "uppercase"
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