# Inventory for playbooks with all uri calls ran local

**URL:** <https://forum.ansible.com/t/inventory-for-playbooks-with-all-uri-calls-ran-local/33192>\
**Category:** Ansible Project\
**Created:** [June 16, 2020, 6:23am UTC](https://forum.ansible.com/t/inventory-for-playbooks-with-all-uri-calls-ran-local/33192 "2020-06-16T06:23:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicholas\_Britton](https://avatars.discourse-cdn.com/v4/letter/n/a587f6/32.png) [@Nicholas\_Britton](https://forum.ansible.com/u/Nicholas_Britton)\
**Post date:** [June 16, 2020, 6:23am UTC](https://forum.ansible.com/t/inventory-for-playbooks-with-all-uri-calls-ran-local/33192/1 "2020-06-16T06:23:35Z")

</div>

I am trying to see how I can setup an inventory file for an application that is all managed by uri calls.

I have multiple end points that will end up with some different vars by host. But I have the host as 127.0.0.1 since everything runs local I thought that would be the way to do it.

I am finding that since I have the same host in different groups it's taking the last car that gets set for all the groups, as designed from what I can see. Is the best option a different inventory file for each end point?

---

<div class="post-metadata">

**Author:** ![Dakota\_Heyman](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@Dakota\_Heyman](https://forum.ansible.com/u/Dakota_Heyman)\
**Post date:** [June 16, 2020, 3:06pm UTC](https://forum.ansible.com/t/inventory-for-playbooks-with-all-uri-calls-ran-local/33192/2 "2020-06-16T15:06:49Z")

</div>

I recently ran into this same situation!

The best way I got around it is to set up a single inventory file and create an “all” group with the variable _ansible\_connection: “local”_  
This way, you can create whatever hosts you want and ansible won’t attempt to actually ssh to any of them, it will know to connect locally (unless you want to override ansible\_connection on a host level).

Example:

all:  
vars:  
ansible\_connection: “local”  
children:  
dbservers:  
vars:  
foo: “bar”  
hosts:  
dbserver1:  
sys: “TEST”

Hope that helps!

- Dakota

---

<div class="post-metadata">

**Author:** ![Nicholas\_Britton](https://avatars.discourse-cdn.com/v4/letter/n/a587f6/32.png) [@Nicholas\_Britton](https://forum.ansible.com/u/Nicholas_Britton)\
**Post date:** [June 16, 2020, 4:07pm UTC](https://forum.ansible.com/t/inventory-for-playbooks-with-all-uri-calls-ran-local/33192/3 "2020-06-16T16:07:16Z")

</div>

It does thanks!! I had the same crazy idea this morning too. Using a dummy name did the trick.
