# Use IP variable rather than host

**URL:** <https://forum.ansible.com/t/use-ip-variable-rather-than-host/35804>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [September 30, 2021, 9:49am UTC](https://forum.ansible.com/t/use-ip-variable-rather-than-host/35804 "2021-09-30T09:49:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tony1](https://avatars.discourse-cdn.com/v4/letter/t/858c86/32.png) [@Tony1](https://forum.ansible.com/u/Tony1)\
**Post date:** [September 30, 2021, 9:49am UTC](https://forum.ansible.com/t/use-ip-variable-rather-than-host/35804/1 "2021-09-30T09:49:01Z")

</div>

Hi,

In AWX I have a bunch of hosts that are not accessible by their name.

All hosts have their own stored variables.

I want to connect to the host via one of the variables:

“private\_ip\_address”: “x.x.x.x”

How do I connect to all hosts via the private IP variable rather than the name?

Cheers

---

<div class="post-metadata">

**Author:** ![Tony1](https://avatars.discourse-cdn.com/v4/letter/t/858c86/32.png) [@Tony1](https://forum.ansible.com/u/Tony1)\
**Post date:** [September 30, 2021, 12:25pm UTC](https://forum.ansible.com/t/use-ip-variable-rather-than-host/35804/2 "2021-09-30T12:25:40Z")

</div>

solved this by using the below in the inventory variables:

ansible\_host: “{{ private\_ip\_address }}”
