I am using Ansible Automation Platform 2.4 and have a inventory setup to import hosts from VMWare. However, the hostnames are an inconsistent mix of upper and lowercase characters.
My inventory script uses config.name for the hostname. Is there a way to convert the config.name to lowercase so each hostname is consistent? I have included the code below in the source variables part of the inventory source.
with_tags: true
properties:
- ‘config.name’
- ‘config.uuid’
- ‘config.guestId’
- ‘summary.runtime.powerState’
compose:
ansible_host: ‘config.name+”.acme.com”‘
hostnames:
- ‘config.name’