# Azure VM's behind Public LoadBalancer

**URL:** <https://forum.ansible.com/t/azure-vms-behind-public-loadbalancer/29509>\
**Category:** Ansible Project\
**Tags:** azure, windows\
**Created:** [January 23, 2019, 9:11pm UTC](https://forum.ansible.com/t/azure-vms-behind-public-loadbalancer/29509 "2019-01-23T21:11:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Cruz](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@Michael\_Cruz](https://forum.ansible.com/u/Michael_Cruz)\
**Post date:** [January 23, 2019, 9:11pm UTC](https://forum.ansible.com/t/azure-vms-behind-public-loadbalancer/29509/1 "2019-01-23T21:11:53Z")

</div>

Hello All,

I have Windows VM’s in Azure behind a Public LoadBalancer the VM’s are set up to use a Network Security Group to keep traffic limited to our office. My inventory.yml is set up by name:port where the last digit is different

[LBName]  
[LBName.eastus.cloudapp.azure.com](http://LBName.eastus.cloudapp.azure.com):xxxx

[LBName.eastus.cloudapp.azure.com](http://LBName.eastus.cloudapp.azure.com):xxxy

[LBName.eastus.cloudapp.azure.com](http://LBName.eastus.cloudapp.azure.com):xxxz

When I run a playbook I normally limit to the Group Name. I keep a separate group\_vars yml for just the login information  
The issue is that because the name is the same for all 3 only the first one ever gets reached for TASK [Gathering Facts]

These machines only have the public IP address which is the LB they have a Private IP which is not accessible at this time. This is why I am using the Public IP Address DNS Name.  
Writing this out I could see a potential solution with creating a new network structure but that has a different issue for me.  
Any ideas?

Thank You!

MAc

---

<div class="post-metadata">

**Author:** ![Michael\_Cruz](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@Michael\_Cruz](https://forum.ansible.com/u/Michael_Cruz)\
**Post date:** [February 8, 2019, 5:06pm UTC](https://forum.ansible.com/t/azure-vms-behind-public-loadbalancer/29509/2 "2019-02-08T17:06:45Z")

</div>

Turns out it was easier than I thought.

[LB:children]  
LB0  
LB1

[LB0]  
VMName00 ansible\_host=[LBName.eastus.cloudapp.azure.com](http://LBName.eastus.cloudapp.azure.com) ansible\_port=xxxx  
[LB1]  
VMName01 ansible\_host=[LBName.eastus.cloudapp.azure.com](http://LBName.eastus.cloudapp.azure.com) ansible\_port=xxxy

MAc
