# Ansible and Inventory

**URL:** <https://forum.ansible.com/t/ansible-and-inventory/17599>\
**Category:** Ansible Project\
**Created:** [February 23, 2015, 7:01pm UTC](https://forum.ansible.com/t/ansible-and-inventory/17599 "2015-02-23T19:01:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Dunbar](https://avatars.discourse-cdn.com/v4/letter/b/4491bb/32.png) [@Brian\_Dunbar](https://forum.ansible.com/u/Brian_Dunbar)\
**Post date:** [February 23, 2015, 7:01pm UTC](https://forum.ansible.com/t/ansible-and-inventory/17599/1 "2015-02-23T19:01:57Z")

</div>

Good: we’ve settled on using Ansible for orchestrating our servers and software.

Problem: keeping up with inventory, and variables.

We’re a hosting company. Items I have to worry about for this include host names, customer names for websites, various settings for this, and that. User names for users to access their hosts.[1]

What are my options for Ansible extracting data from an external source for inventory?

Appreciate any replies in advance,

~brian

[1] We currently have two, canonical sources of information: Confluence and our CRM. But I can use anything if it works.

---

<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:** [February 23, 2015, 7:09pm UTC](https://forum.ansible.com/t/ansible-and-inventory/17599/2 "2015-02-23T19:09:35Z")

</div>

​Hi Brian,  
​

> What are my options for Ansible extracting data from an external source  
> for inventory?

​The easy answer, is 'dynamic inventory' where you can write whatever  
script in whatever language you want, that returns all your data​ in a  
specific JSON scheme:

&nbsp;&nbsp;&nbsp;&nbsp;[http://docs.ansible.com/intro\_dynamic\_inventory.html](http://docs.ansible.com/intro_dynamic_inventory.html)

Of course, translating such data into the ansible model, with (parent/child  
inheriting) groups and hosts, demands more thought, and also strongly  
depends on the way you want to write your playbooks, possibly think of  
things like dev vs testing vs production etc.

> [1] We currently have two, canonical sources of information: Confluence  
> and our CRM. But I can use anything if it works.

​If your source has some API you can query from said script, your are good  
to go.  
(I'm not sure how you would query structured data from Confluence​

​though.)

&nbsp;&nbsp;&nbsp;&nbsp;Serge​
