# Docker Inventory Module + Configuration

**URL:** <https://forum.ansible.com/t/docker-inventory-module-configuration/15027>\
**Category:** Ansible Developer\
**Created:** [April 15, 2014, 9:59pm UTC](https://forum.ansible.com/t/docker-inventory-module-configuration/15027 "2014-04-15T21:59:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Durivage](https://avatars.discourse-cdn.com/v4/letter/p/94ad74/32.png) [@Paul\_Durivage](https://forum.ansible.com/u/Paul_Durivage)\
**Post date:** [April 15, 2014, 9:59pm UTC](https://forum.ansible.com/t/docker-inventory-module-configuration/15027/1 "2014-04-15T21:59:16Z")

</div>

Hey guys,

I’m in the process of wrapping up on a Docker inventory plugin, but before I open a pull request, I wanted to check about something.

Here’s a link for those interested: [https://github.com/angstwad/ansible/tree/docker\_inv/plugins/inventory](https://github.com/angstwad/ansible/tree/docker_inv/plugins/inventory)

The question is about my use of a YAML-formatted confuration file. Note, this is in addition to supporting environment variables. I noticed that nearly all the modules in Inventory are using INI-formatted files, but this is probably because their dependent libraries support INI-formatted config files. Since docker-py has no such support, I figured I’d go with YAML files. The YAML config file enumerates Docker hosts and options, and a defaults section that could apply to all hosts.

tl;dr: I use a YAML file for enumerating Docker hosts. Everything else seems to use INI. INI files are (mostly) dumb.

Thanks!

---

<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:** [April 15, 2014, 10:28pm UTC](https://forum.ansible.com/t/docker-inventory-module-configuration/15027/2 "2014-04-15T22:28:19Z")

</div>

If you think it needs structured data that seems reasonable…

The hosts section being blank in the sample file is a bit confusing to me, maybe include some commented out hosts?

Note in reading the code inventory plugins don’t have a DOCUMENTATION section for auto-generated docs so you can drop that boilerplate, instead include notes on configuration as docs in the config file. Otherwise it’s a bit confusing as I’m reading the docs expecting it to be a module, and it’s unclear what the config file might look like.

(Do I read the source correctly that this will be able to index containers running on multiple hosts? If so, this would be very very good – it seems also nice if it would return the lists of configured hosts in a “docker\_hosts” group or equivalent, so that you could use the docker module to add more to them?)

Thanks!!
