openstack os_project endpoint error

771 views
Skip to first unread message

Scott

unread,
Feb 8, 2016, 4:50:26 AM2/8/16
to Ansible Project
We have just deployed a new openstack (HP HELION) enviroment and trying to use ansible to createa project but getting an error "Could not find a suitable endpoint for client version: 2.0".  

ansible version:   2.0.0.2

These are the enviroment settings to be used with openstack:

export OS_AUTH_URL=http://<fqdn of server>:35357/v3
export OS_TENANT_NAME="<a tenant name>"
export OS_PROJECT_NAME="<a projetc name  same as tenant>"
export OS_DOMAIN_NAME="default"
export OS_USERNAME="ansible"
export OS_PASSWORD=<some password>
export OS_REGION_NAME="region1"

Ansible role code:

- os_project:
    state: present
    name: "{{projectName}}"
    description: "{{projectDescription}}"
    validate_certs: False
    enabled: True

Ansible output

localhost EXEC ( umask 22 && mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1454921235.76-802231271404 )" && echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1454921235.76-802231271404 )" )
localhost PUT /tmp/tmpituEhC TO /home/vagrant/.ansible/tmp/ansible-tmp-1454921235.76-802231271404/os_project
localhost EXEC LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1454921235.76-802231271404/os_project; rm -rf "/home/vagrant/.ansible/tmp/ansible-tmp-1454921235.76-802231271404/" > /dev/null 2>&1
fatal: [localhost]: FAILED! => {"changed": false, "extra_data": null, "failed": true, "invocation": {"module_args": {"api_timeout": null, "auth": null, "auth_type": null, "availability_zone": null, "cacert": null, "cert": null, "cloud": null, "description": "This is a sample Project", "domain_id": null, "enabled": true, "endpoint_type": "admin", "key": null, "name": "sampleProject", "region_name": null, "state": "present", "timeout": 180, "validate_certs": false, "verify": false, "wait": true}, "module_name": "os_project"}, "msg": "Could not find a suitable endpoint for client version: 2.0"}

I can create the resouce using the same credentials using the openstackclient cli so credentials appear to be OK. I have tried changing the endpoint_type to internal and admin with no difference in error output.  Unsure why endpoint is returning 2.0 when auth URL is V3 supplied though.  I did try changing the URL to the V2.0 entry but errors on domain name.  We use domains and belive API V2.0 doesn't support them.

Any help on this would be appreciated.

David Shrewsbury

unread,
Feb 8, 2016, 11:59:28 AM2/8/16
to Ansible Project
You need to tell it to use the v3 api for keystone. It defaults to 2, currently.

  OS_IDENTITY_API_VERSION="3"

Scott

unread,
Feb 16, 2016, 3:25:50 AM2/16/16
to Ansible Project

Thanks for reply.  Tried settings as mentioned and now get is "The request you have made requires authentication. (HTTP 401) (Request-ID: req-3b396e91-c949-4956-b724-9b716c1f19df)".  I know the user I'm using is OK because when I run the openstack cli using same credentials it works.  I have just noticed that on some of my openstack CLI commands,  I need to set "--os-identity-api-version 3"  and some need "--os-identity-api-version 2.0".  This mismatch of APV Version calls is what I think maybe causing the issue.  Have a call to HP to query if this is correct.  But is there a way within the auth section of the module to specify which API version to use?

David Shrewsbury

unread,
Feb 17, 2016, 4:12:28 PM2/17/16
to Ansible Project
You can set your auth parameters within each task of your playbook. Not as convenient, obviously.
If you do that, you should not mix env variables with auth params in the playbook. You could also
define two clouds in a clouds.yaml file (see http://docs.openstack.org/developer/os-client-config/),
one with v2 and the other with v3 and just name the cloud in each task. Again, don't mix env variables
and use of clouds.yaml.

Scott

unread,
Feb 19, 2016, 7:48:27 AM2/19/16
to Ansible Project

Thanks for the assistance.  I'm  wokring my way through that link :-)  

Lokeshwar K'seven

unread,
Mar 24, 2017, 1:28:58 AM3/24/17
to Ansible Project
Hi Scott,

    Did you find a workaround for this issue? I am stuck at the same point now. Any help is appreciated.


Regards,
Lokesh
Reply all
Reply to author
Forward
0 new messages