How to use Ansible Tower with Azure

Hi, I want to use Ansible Tower to do automation tasks on VM’s in the Azure Cloud. The inventory process of ansible tower gets the hostnames of the vm’s. I cannot use these hostnames in the playbooks because I need the ipaddress. Is it possible to use the ipaddress.



Hi @Arjan
You can change inventory script to meet you needs. I do it for CloudFOrms inventory script because I need some other way of grouping hosts. Try to investigate /var/lib/awx/venv/tower/lib/python2.7/site-packages/awx/plugins/inventory/ in you Tower server. For example you should add ansible_ssh_host=ipaddress to the host variables during inventory run and your hosts will be have inventory hostname, but the connection will be by ipaddresses.

1 Like

Thanks, i wil try this.