Ansible and Inventory

35 views
Skip to first unread message

Brian Dunbar

unread,
Feb 23, 2015, 2:01:57 PM2/23/15
to ansible...@googlegroups.com
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.

Serge van Ginderachter

unread,
Feb 23, 2015, 2:09:59 PM2/23/15
to ansible...@googlegroups.com
​Hi Brian,

On 23 February 2015 at 20:01, Brian Dunbar <brian....@gmail.com> wrote:
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:

    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.)


    Serge​


Reply all
Reply to author
Forward
0 new messages