OpenStack Dynamic Inventory Question

Hi,

I’m trying to configure OpenStack dynamic inventory with Ansible, but I keep getting the following error:

mikealbert@rmbp lab (master) $ ./openstack.py --list
Error fetching server list on envvars:Region1:

I’ve defined the variables below in my .bash_profile and I’ve confirmed that “nova list” returns results

OS_REGION_NAME
OS_PASSWORD
OS_AUTH_URL
OS_USERNAME
OS_TENANT_NAME

Not sure if it makes a difference but I’m running Ansible 2.0.1.0.

I’m also getting this error. Maybe something in shade or os-client-config changed? Maybe Monty knows?

-tim

Here’s what I’m running locally.

ansible==2.0.1.0
os-client-config==1.16.0
shade==1.4.0

I updated to shade 1.5.1 and it resolved this issue.

I thought upgrading to shade 1.5.1 resolved our inventory issue but on second glance, openstack.py --list is not returning all the compute instances in our environment.

We tested the old openstack dynamic inventory script (https://github.com/ansible/ansible/blob/devel/contrib/inventory/nova.py) and that script works correctly.

Is anyone else having dynamic inventory issues with Ansible 2.0 and the new openstack.py inventory script?

There are two things you should try to help us track down the problem, if you don’t mind.

First of all:

openstack server list

(python-openstackclient also uses occ, so that should let us know that the config is working right)

If that works and you see the servers, my hunch is that ansible cannot figure out the interface_ip of your server, which means our introspection code is making an assumption. So if you can try making a copy of openstack.py and editing it - find this:

if ‘interface_ip’ not in server:
continue

and delete it

If openstack.py --list works at that point, I’d really love if you’d be kind enough to send me a copy of the output of at least one of the servers so I can see what’s going on with your addresses list. (there should be nothing in the output that would be compromosing, but you migth want to scan it - feel free to send the entire output or just one server. OR - if you don’t want to do that, I can cook up some more code snippets for you to try to diagnose further.

thanks!

Sorry about the delay in responding.

Just to add a bit more info, we are actually using an external service which provides an openstack layer on top of our vmware infrastructure. While working with that vendor, they found that the dynamic inventory script for openstack assumes neutron networking when they were actually using nova networking. Their dev team provided a modified script to us, and we are now able to query the inventory successfully.