# benefit of Dynamic Inventory over static inventory

**URL:** <https://forum.ansible.com/t/benefit-of-dynamic-inventory-over-static-inventory/16911>\
**Category:** Ansible Project\
**Created:** [November 28, 2014, 12:18pm UTC](https://forum.ansible.com/t/benefit-of-dynamic-inventory-over-static-inventory/16911 "2014-11-28T12:18:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Usama\_Mehboob](https://avatars.discourse-cdn.com/v4/letter/u/9de0a6/32.png) [@Usama\_Mehboob](https://forum.ansible.com/u/Usama_Mehboob)\
**Post date:** [November 28, 2014, 12:18pm UTC](https://forum.ansible.com/t/benefit-of-dynamic-inventory-over-static-inventory/16911/1 "2014-11-28T12:18:22Z")

</div>

I have written dynamic inventory scripts [https://dpaste.de/1mVa](https://dpaste.de/1mVa) . But I dont get whats the benefit of using dynamic inventory. I still had to list all the things which I used in static inventory. could you tell me in what way I can get most out of dynamic inventory. In what ways It is better to use, right now I dont think so

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [November 28, 2014, 3:38pm UTC](https://forum.ansible.com/t/benefit-of-dynamic-inventory-over-static-inventory/16911/2 "2014-11-28T15:38:09Z")

</div>

Well, dynamic inventories make sense when you have an external source  
(cloud provider, vm system, db, inventory system, ldap, etc) not when  
you are just listing the hosts manually. If that is the case just  
stick with the ini format.

---

<div class="post-metadata">

**Author:** ![Dann\_Bohn](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@Dann\_Bohn](https://forum.ansible.com/u/Dann_Bohn)\
**Post date:** [November 29, 2014, 4:21am UTC](https://forum.ansible.com/t/benefit-of-dynamic-inventory-over-static-inventory/16911/3 "2014-11-29T04:21:26Z")

</div>

One added benifit of dynamic inventories is support for more complex facts. You can set lists and dictionaries as facts with a dynamic source, and you can't with the ini format. That said, it looks like in your case sticking with ini may be the way to go.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [November 29, 2014, 4:58am UTC](https://forum.ansible.com/t/benefit-of-dynamic-inventory-over-static-inventory/16911/4 "2014-11-29T04:58:21Z")

</div>

With both formats, you can do complex variables using the  
host\_vars/\<hostname\> group\_vars/\<groupname\> with yaml files.
