ansible-galaxy github-token calling non-existant API endpoint

85 views
Skip to first unread message

Bryan Hunt

unread,
Dec 17, 2015, 1:04:03 PM12/17/15
to Ansible Project

Hi there, it seems an API endpoint may have vanished.


From - http://docs.ansible.com/ansible/galaxy.html


Authenticate with Galaxy


"If you do not wish to use your GitHub password, or if you have two-factor authentication enabled with GitHub, use the –github-token 
option to pass a personal access token that you create. Log into GitHub, go to Settings and click on Personal Access Token to create a token"

The command line was throwing an exception about inability to JSON decode the response - so I inserted a breakpoint into lib/ansible/galaxy/api.py

From there, I discovered the URL and POST parameters being used. I then tried calling from the command line using CURL.

(I've stripped private info from the token)

[~%]curl -XPOST "https://galaxy.ansible.com/api/v1/tokens" --data "github_token=XXXXXXXXXXXXXa934c175XXXXXXXXDXXXXXXXXe9d" | head
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5934 0 5881 100 53 6447 58 --:--:-- --:--:-- --:--:-- 6448


<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Ansible, Inc" />
<link rel="shortcut icon" href="/static/img/favicon.ico" />


It seems like the API endpoint is down or not mapped correctly or.. suggestions please?

I'm using Ansible from git, tried with versions devel and stable-2.0.

Any ideas?

Bryan





Chris Houseknecht

unread,
Dec 17, 2015, 3:11:55 PM12/17/15
to Ansible Project
The doc site is not up to speed with the latest in the stable-2.0 branch. If it were, you would see a note explaining the following:

Note
The login command in Ansible 2.0 requires using the Galaxy 2.0 Beta site. Use the --server option to access https://galaxy-qa.ansible.com. You can also add a server definition in the [galaxy] section of your ansible.cfg file.


So as the above note explains, the login command only works with the beta site. This is true for import, delete and setup commands as well.

Apologies for the confusion. I'll see what we can do to update the doc site. 


--Chris

bryan hunt

unread,
Dec 17, 2015, 3:28:02 PM12/17/15
to ansible...@googlegroups.com
Thanks for the quick response Chris !

B

-- 
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/UG0hC9JcErM/unsubscribe.
To unsubscribe from this group and all its topics, 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/37f078bb-2ff6-4d03-b90d-e915f89e0df9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages