# Rework of Nova Dynamic Inventory Plugin reviewers needed for pull request

**URL:** <https://forum.ansible.com/t/rework-of-nova-dynamic-inventory-plugin-reviewers-needed-for-pull-request/16047>\
**Category:** Ansible Developer\
**Created:** [August 26, 2014, 9:44pm UTC](https://forum.ansible.com/t/rework-of-nova-dynamic-inventory-plugin-reviewers-needed-for-pull-request/16047 "2014-08-26T21:44:13Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patrick\_Galbraith](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@Patrick\_Galbraith](https://forum.ansible.com/u/Patrick_Galbraith)\
**Post date:** [August 26, 2014, 9:44pm UTC](https://forum.ansible.com/t/rework-of-nova-dynamic-inventory-plugin-reviewers-needed-for-pull-request/16047/1 "2014-08-26T21:44:13Z")

</div>

Hi all!

I was hoping I could get some reviewers on my pull request for Nova dynamic inventory plugin? Monty Taylor added yet more useful functionality on top of my original working. I was focused on getting it to work with more modern Novas, he added all sorts of great features such as multi-cloud, made it a class as well as cache (see pull request for full details).

The pull request is here: [https://github.com/ansible/ansible/pull/8388](https://github.com/ansible/ansible/pull/8388)

Michael asked me to run this by this group. I would be more than glad to answer any questions you all have.

---

<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:** [August 26, 2014, 11:15pm UTC](https://forum.ansible.com/t/rework-of-nova-dynamic-inventory-plugin-reviewers-needed-for-pull-request/16047/2 "2014-08-26T23:15:09Z")

</div>

Thanks for passing it by, testing would be great, as I don’t want to replace a rewrite unless some folks have helped test.

Perhaps a simple playbook run that calls nothing more than the ping module would make for a good test by other folks.

I’m not _too_ interested in Rackspace support for multi-cloud as right now Rackspace wants to use the Rackspace inventory script for various current and future optimizations (Matt, correct me if I’m putting words in your mouth), but I can totally see HP-specifics/generic-openstack/other being nice here.

–Michael

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [August 27, 2014, 12:16pm UTC](https://forum.ansible.com/t/rework-of-nova-dynamic-inventory-plugin-reviewers-needed-for-pull-request/16047/3 "2014-08-27T12:16:14Z")

</div>

You aren’t putting words in my mouth. Ideally the way Rackspace likes to approach these things is that it should be as simple as can be for users to use our SDKs and such, by taking away the burden of having to configure too many things. With a username and API key you are ready to roll without additional knowledge of the API.

As discussed recently, the rax.py inventory script along with most of the rax modules also work with other OpenStack installs as well, we just don’t really advertise it very much, other than you can see some of the options in the modules that would enable you to do so.

This multi-cloud functionality in the rax inventory and modules was largely added to support people using both Rackspace Public and Private cloud, as well as allowing us to use the same modules to manage our cloud infra.

---

<div class="post-metadata">

**Author:** ![Patrick\_Galbraith](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@Patrick\_Galbraith](https://forum.ansible.com/u/Patrick_Galbraith)\
**Post date:** [August 27, 2014, 3:44pm UTC](https://forum.ansible.com/t/rework-of-nova-dynamic-inventory-plugin-reviewers-needed-for-pull-request/16047/4 "2014-08-27T15:44:35Z")

</div>

Michael,

HP doesn’t have any specifics outside of stock OpenStack and as far as I recall (I can be corrected) that Rackspace is moving to stock openstack as well (?) and that’s one of the reasons why Monty wanted to make sure to add multi-cloud support.

Regards,

Patrick

---

<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:** [August 28, 2014, 9:19pm UTC](https://forum.ansible.com/t/rework-of-nova-dynamic-inventory-plugin-reviewers-needed-for-pull-request/16047/5 "2014-08-28T21:19:07Z")

</div>

I’m referring to a conversation with Monty about some tweaks to make it work with something about HP Cloud.

It could be something as simple as region options that aren’t normally there.

I could be misremembering.

---

<div class="post-metadata">

**Author:** ![Patrick\_Galbraith](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@Patrick\_Galbraith](https://forum.ansible.com/u/Patrick_Galbraith)\
**Post date:** [August 29, 2014, 8:40pm UTC](https://forum.ansible.com/t/rework-of-nova-dynamic-inventory-plugin-reviewers-needed-for-pull-request/16047/6 "2014-08-29T20:40:01Z")

</div>

Michael,

That sounds good to me and I’ll give it a go as well as talk to Monty et al about it.

Regards,

Patrick

---

<div class="post-metadata">

**Author:** ![Monty\_Taylor](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@Monty\_Taylor](https://forum.ansible.com/u/Monty_Taylor)\
**Post date:** [August 29, 2014, 11:51pm UTC](https://forum.ansible.com/t/rework-of-nova-dynamic-inventory-plugin-reviewers-needed-for-pull-request/16047/7 "2014-08-29T23:51:50Z")

</div>

Hi,

My concern with Rackspace support in the nova module has nothing to do with making Rackspace happy - it has to do with making OpenStack users who happen to also be Rackspace customers happy. For instance, I currently runs a large production system that spans Rackspace Public, HP Public and two private clouds, so we tend to very explicitly use OpenStack interfaces and not vendor-specific ones, since vendor specific interfaces increase the amount of work we have to do. If the rax modules are sufficient for someone who is only a Rackspace customer, that’s awesome, truly. But I want to make very certain that the OpenStack modules work for everyone regardless of cloud vendor.

So for me, my testing involved making sure it worked with all of the running OpenStack clouds, including Rackspace, that I have accounts on and that I currently use custom written python-novaclient scripts to interact with. In a perfect world, I will be able to replace my custom written scripts with Ansible playbooks that use the nova\_compute module to provision nodes and the nova\_inventory plugin to manage the inventory. The posted pull request works well for me at least - a gist with the output can be found here:

[https://gist.github.com/emonty/0f9d8237bd0df777c6df](https://gist.github.com/emonty/0f9d8237bd0df777c6df)

(That’s just the output of our production rackspace account, I have also tested that it works in the multi-cloud config and can re-do that and re-gist it for folks if you like)

So in any case - I’ve tested the nova\_inventory plugin against all of those clouds listed above. I have _not_ tested that it works as an upgrade to my existing production setup, since I didn’t have one of those before since it did not work for me. 🙂 I’d really love some help testing that the changes here don’t break previous nova\_inventory users who may have had a use case we didn’t think of. But I think, from looking at the old config reading code, that it should work as expected … just perhaps with some more data returned in host\_vars.

---

<div class="post-metadata">

**Author:** ![Monty\_Taylor](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@Monty\_Taylor](https://forum.ansible.com/u/Monty_Taylor)\
**Post date:** [August 30, 2014, 2:38am UTC](https://forum.ansible.com/t/rework-of-nova-dynamic-inventory-plugin-reviewers-needed-for-pull-request/16047/8 "2014-08-30T02:38:06Z")

</div>

For completeness - here’s the output of running it against my personal accounts (two of them) on HP Cloud:

[https://gist.github.com/1e52f2142af272d760d7](https://gist.github.com/1e52f2142af272d760d7)

For that one, nova.ini is configured with two sections, one called “monty” and one called “mordred”

Then, I ran it again:

[https://gist.github.com/d382cb66a18aa7fb843f](https://gist.github.com/d382cb66a18aa7fb843f)

---

<div class="post-metadata">

**Author:** ![Tomas\_Karasek](https://avatars.discourse-cdn.com/v4/letter/t/f1d935/32.png) [@Tomas\_Karasek](https://forum.ansible.com/u/Tomas_Karasek)\
**Post date:** [October 20, 2014, 11:17am UTC](https://forum.ansible.com/t/rework-of-nova-dynamic-inventory-plugin-reviewers-needed-for-pull-request/16047/9 "2014-10-20T11:17:52Z")

</div>

Hello,  
I did another rework of the Nova inventory, I hope I am not spamming this. I tried to cover the features in your PR and add some. To compare the config, in my PR you can do sth like:

openstack\_dev:  
auth\_url: https://cloud\_dev.example.fi:5001/v2.0  
username: tomas.karasek  
api\_key: XXXXXXXXX  
project\_id: [tenantA, tenantB]

openstack\_prod:  
auth\_url: https://cloud\_prod.example.fi:5001/v2.0  
username: tomas.karasek  
api\_key: XXXXXXXXX  
project\_id: [tenant1, tenant2]  
regoin\_name: [DFW,ORD]

and you will have groups for openstack\_dev, openstack\_prod, tenantA, tenantB, tenant1, tenant2, DFW, ORD

Or you can just choose to omit the config and the plugin will use what’s in os.environ[OS\_\*]

The pull request:  
[https://github.com/ansible/ansible/pull/9378](https://github.com/ansible/ansible/pull/9378)

Cheers,  
Tomas
