# Inventory plugin now available to read from ansible-commander, better setup instructions

**URL:** <https://forum.ansible.com/t/inventory-plugin-now-available-to-read-from-ansible-commander-better-setup-instructions/11888>\
**Category:** Ansible Project\
**Created:** [September 13, 2012, 1:37am UTC](https://forum.ansible.com/t/inventory-plugin-now-available-to-read-from-ansible-commander-better-setup-instructions/11888 "2012-09-13T01:37:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [September 13, 2012, 1:37am UTC](https://forum.ansible.com/t/inventory-plugin-now-available-to-read-from-ansible-commander-better-setup-instructions/11888/1 "2012-09-13T01:37:19Z")

</div>

See the updated setup instructions here --

[https://github.com/ansible/ansible-commander/blob/master/README.md](https://github.com/ansible/ansible-commander/blob/master/README.md)

This is more setup than I'd actually like, but I think it's ok because  
you're only going to have to do it once. I also want people to  
understand a bit about how it works. (Seem reasonable?)

I made a choice in doing this where the acom\_inventory.py plugin for  
ansible speaks REST to the ansible-commander server to get inventory  
data. This allows configuration of multiple remote ansible machines  
to point to a single ansible-commander as an inventory source. This  
is why you have to configure a limited shared secret key -- just so  
you don't share host variables with machines that don't have any  
business reading them. If you are not setting passwords in your  
variables, even this doesn't matter so much.

Here it is (rough cut):

[https://github.com/ansible/ansible-commander/blob/master/inventory\_script/acom\_inventory.py](https://github.com/ansible/ansible-commander/blob/master/inventory_script/acom_inventory.py)

(and trivial config file):

[https://github.com/ansible/ansible-commander/blob/master/inventory\_script/acom\_inventory.cfg](https://github.com/ansible/ansible-commander/blob/master/inventory_script/acom_inventory.cfg)

Anyway, things are in place to allow the REST API to be used for  
inventory now -- at least in theory. Test if you like and let me  
know if there are quirks, but it will be much easier to test manually  
once the UI starts to allow us to muck with objects instead of  
throwing JSON at URLs.

So yeah --The UI development can now begin, which I plan to work on  
some in the coming days. I'm going to start by getting some of the  
infrastructure in place and making sure the components I think I want  
to use are sane. The interface to edit users will come first,  
followed shortly by groups and hosts. I suspect once I get the  
basics off the ground, there's going to be tons of room for people to  
submit some neat stuff -- and from what I have seen so far, I am  
supremely impressed by a lot of your skills and am super excited about  
where this might go!

Let me know if there are questions and please let me know if the setup  
process doesn't make a lot of sense.

Thanks!

--Michael

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [September 13, 2012, 1:05pm UTC](https://forum.ansible.com/t/inventory-plugin-now-available-to-read-from-ansible-commander-better-setup-instructions/11888/2 "2012-09-13T13:05:09Z")

</div>

I was thinking about the setup process a bit.

To simplify setup, it also occurs to me that we could easily make  
acom\_inventory plugin only speak locally for those that wanted it,  
this would probably be done by adding a "mode=" flag to both  
acom\_inventory.py and commander.py (to shut it off), where it wouldn't  
be remote (web servicey) except on machines that it needed to be  
remote.

This would be suitable if you only ran Ansible from one machine. The  
REST API would be accessible anywhere (authenticated) but when ansible  
goes to fetch host data, it could just hit the database, meaning the  
inventory variables need not be surfaced.

This also means that users don't have to initially set up as many  
settings, which yields quicker gains.

(It also has the bonus points of being blazing fast and not even  
needing the flask component running)

---

<div class="post-metadata">

**Author:** ![Romeo\_Theriault](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@Romeo\_Theriault](https://forum.ansible.com/u/Romeo_Theriault)\
**Post date:** [September 13, 2012, 8:38pm UTC](https://forum.ansible.com/t/inventory-plugin-now-available-to-read-from-ansible-commander-better-setup-instructions/11888/3 "2012-09-13T20:38:23Z")

</div>

Man you're fast! Do you have a day job 😉 But in regards to the  
installation, it looks completely reasonable to me.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [September 14, 2012, 12:29am UTC](https://forum.ansible.com/t/inventory-plugin-now-available-to-read-from-ansible-commander-better-setup-instructions/11888/4 "2012-09-14T00:29:24Z")

</div>

Thankfully, yes, I'm just fast!

Good deal, thanks for looking it over.
