# Google Cloud dynamic inventory (gce.py) and authentication

**URL:** <https://forum.ansible.com/t/google-cloud-dynamic-inventory-gce-py-and-authentication/18067>\
**Category:** Ansible Project\
**Created:** [April 23, 2015, 8:22pm UTC](https://forum.ansible.com/t/google-cloud-dynamic-inventory-gce-py-and-authentication/18067 "2015-04-23T20:22:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Synaesthete](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@Synaesthete](https://forum.ansible.com/u/Synaesthete)\
**Post date:** [April 23, 2015, 8:22pm UTC](https://forum.ansible.com/t/google-cloud-dynamic-inventory-gce-py-and-authentication/18067/1 "2015-04-23T20:22:59Z")

</div>

I think this is more of a libcloud question, but I’m starting here hoping others have encountered the same issue.

I’m using the gce.py script found in the ansible repository to return a dynamic inventory of my GCE instances. When I run

`./gce.py --list`

I get the following prompt:

`

Please Go to the following URL and sign in:

[https://accounts.google.com/o/oauth2/auth?](https://accounts.google.com/o/oauth2/auth?)

Enter Code:

`

When I visit the URL I get a 404, so am not able to get a code. I thought that by referencing the .pem file I derived for the service account, I would not need further authentication. Additionally, I’d like to run this script from a CI server… ideally all my authentication details would be environment variables rather than stored in a file. And I can’t exactly manually authenticate on a CI server every time I access gce.py.

Has anyone else run in to these issues? How are people CI-ing to GCE using Ansible?

---

<div class="post-metadata">

**Author:** ![Synaesthete](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@Synaesthete](https://forum.ansible.com/u/Synaesthete)\
**Post date:** [April 23, 2015, 8:57pm UTC](https://forum.ansible.com/t/google-cloud-dynamic-inventory-gce-py-and-authentication/18067/2 "2015-04-23T20:57:14Z")

</div>

So I found out I should not have been including quotes in my gce.ini file.

Though, I’m still not able to authenticate, getting the following error:

libcloud.common.google.GoogleAuthError: ‘Invalid authorization response, please check your credentials.’

I’ve followed the instructions pretty closely, and have no idea how to begin troubleshooting this.

---

<div class="post-metadata">

**Author:** ![Felix\_Glaske](https://avatars.discourse-cdn.com/v4/letter/f/b77776/32.png) [@Felix\_Glaske](https://forum.ansible.com/u/Felix_Glaske)\
**Post date:** [June 12, 2015, 1:24pm UTC](https://forum.ansible.com/t/google-cloud-dynamic-inventory-gce-py-and-authentication/18067/3 "2015-06-12T13:24:42Z")

</div>

exactly the same problem here

---

<div class="post-metadata">

**Author:** ![Felix\_Glaske](https://avatars.discourse-cdn.com/v4/letter/f/b77776/32.png) [@Felix\_Glaske](https://forum.ansible.com/u/Felix_Glaske)\
**Post date:** [June 12, 2015, 2:10pm UTC](https://forum.ansible.com/t/google-cloud-dynamic-inventory-gce-py-and-authentication/18067/4 "2015-06-12T14:10:30Z")

</div>

Check out: [https://github.com/ansible/ansible/issues/11245](https://github.com/ansible/ansible/issues/11245)

I had entered the wrong email address for the authentication.
