# Multiple inventory sources

**URL:** <https://forum.ansible.com/t/multiple-inventory-sources/16795>\
**Category:** Ansible Project\
**Created:** [November 14, 2014, 9:00pm UTC](https://forum.ansible.com/t/multiple-inventory-sources/16795 "2014-11-14T21:00:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_Quinot](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@Thomas\_Quinot](https://forum.ansible.com/u/Thomas_Quinot)\
**Post date:** [November 14, 2014, 9:00pm UTC](https://forum.ansible.com/t/multiple-inventory-sources/16795/1 "2014-11-14T21:00:40Z")

</div>

Redirecting from -devel as advised.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [November 17, 2014, 8:18pm UTC](https://forum.ansible.com/t/multiple-inventory-sources/16795/2 "2014-11-17T20:18:57Z")

</div>

I don’t think as inventory directories are an existing thing.

That being said, any alternative way of managing inventory you want can be built using an inventory script.

---

<div class="post-metadata">

**Author:** ![Thomas\_Quinot](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@Thomas\_Quinot](https://forum.ansible.com/u/Thomas_Quinot)\
**Post date:** [November 18, 2014, 9:57am UTC](https://forum.ansible.com/t/multiple-inventory-sources/16795/3 "2014-11-18T09:57:51Z")

</div>

\* Michael DeHaan, 2014-11-17 :

> I don't think as inventory directories are an existing thing.

Not sure what you mean, as far as I can tell this is supported  
by ansible.inventory.dir, and documented under "Using Multiple Inventory  
Sources".

> That being said, any alternative way of managing inventory you want can be  
> built using an inventory script.

That's true, but would require reimplementing the parsing of standard  
inventoy files in the dynamic inventory script.

Thomas.

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [November 18, 2014, 11:05am UTC](https://forum.ansible.com/t/multiple-inventory-sources/16795/4 "2014-11-18T11:05:11Z")

</div>

​Not reinventing, you van just import the ansible.inventory​ in your script  
and use it (on your specific paths.)

E.g. this example script dumps the whole inventory in a dynamic script  
compatible json:

[https://github.com/ginsys/ansible-plugins/blob/devel/bin/ansible-inventory](https://github.com/ginsys/ansible-plugins/blob/devel/bin/ansible-inventory)
