OpenStack Dynamic Inventory Question

499 views
Skip to first unread message

Mike Albert

unread,
Mar 9, 2016, 3:27:33 PM3/9/16
to Ansible Project
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.

Tim

unread,
Mar 9, 2016, 3:43:42 PM3/9/16
to ansible...@googlegroups.com

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

-tim

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/b811f7e2-ab31-4591-861c-90294cdbc3bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mike Albert

unread,
Mar 9, 2016, 4:12:53 PM3/9/16
to Ansible Project
Here's what I'm running locally.

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

Mike Albert

unread,
Mar 10, 2016, 12:49:57 PM3/10/16
to Ansible Project
I updated to shade 1.5.1 and it resolved this issue.

Mike Albert

unread,
Mar 18, 2016, 9:42:55 AM3/18/16
to Ansible Project
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?

Monty Taylor

unread,
Mar 18, 2016, 3:37:08 PM3/18/16
to Ansible Project
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!

Mike Albert

unread,
Mar 29, 2016, 3:03:56 PM3/29/16
to Ansible Project
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.
Reply all
Reply to author
Forward
0 new messages