How to use Ansible Tower with Azure

automate

#1

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.

Regards,

Arjan


#2

Hi @Arjan
You can change windows_azure.py 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/windows_azure.py 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.


#3

Thanks, i wil try this.