# Struggling with Ansible GCE inventory

**URL:** <https://forum.ansible.com/t/struggling-with-ansible-gce-inventory/23668>\
**Category:** Ansible Project\
**Created:** [February 7, 2017, 3:44pm UTC](https://forum.ansible.com/t/struggling-with-ansible-gce-inventory/23668 "2017-02-07T15:44:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tzach\_Livyatan2](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@Tzach\_Livyatan2](https://forum.ansible.com/u/Tzach_Livyatan2)\
**Post date:** [February 7, 2017, 3:44pm UTC](https://forum.ansible.com/t/struggling-with-ansible-gce-inventory/23668/1 "2017-02-07T15:44:08Z")

</div>

I’m following the instructions at [http://docs.ansible.com/ansible/guide\_gce.html](http://docs.ansible.com/ansible/guide_gce.html) but failed to get gce.py running  
`  
./inventories/gce/gce.py --list

Traceback (most recent call last):  
File “./inventories/gce/gce.py”, line 374, in   
GceInventory()  
File “./inventories/gce/gce.py”, line 115, in **init**  
self.driver = self.get\_gce\_driver()  
File “./inventories/gce/gce.py”, line 230, in get\_gce\_driver  
gce = get\_driver(Provider.GCE)(\*args, \*\*kwargs)  
File “/usr/lib/python2.7/site-packages/libcloud/compute/drivers/gce.py”, line 1697, in **init**  
super(GCENodeDriver, self). **init** (user\_id, key, \*\*kwargs)  
File “/usr/lib/python2.7/site-packages/libcloud/common/base.py”, line 1190, in **init**  
self.connection = self.connectionCls(\*args, \*\*conn\_kwargs)  
File “/usr/lib/python2.7/site-packages/libcloud/compute/drivers/gce.py”, line 98, in **init**  
credential\_file=credential\_file, \*\*kwargs)  
File “/usr/lib/python2.7/site-packages/libcloud/common/google.py”, line 765, in **init**  
user\_id, key, auth\_type, credential\_file, scopes, \*\*kwargs)  
File “/usr/lib/python2.7/site-packages/libcloud/common/google.py”, line 651, in **init**  
self.user\_id, self.key, self.scopes, \*\*kwargs)  
File “/usr/lib/python2.7/site-packages/libcloud/common/google.py”, line 493, in **init**  
“file: ‘%s’” % key)  
ValueError: Missing (or not readable) key file: ‘’

`

I set the following env vars:

`

export GCE\_EMAIL=my GCE client email  
export GCE\_PROJECT=my project  
export GCE\_CREDENTIALS\_FILE\_PATH=path to json file

`

the following works fine:

`  
gcloud compute instances list

`  
so the problem is not with my connectivity or permissions.

Any idea will be appreciated

Regards  
Tzach

---

<div class="post-metadata">

**Author:** ![Tzach\_Livyatan2](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@Tzach\_Livyatan2](https://forum.ansible.com/u/Tzach_Livyatan2)\
**Post date:** [February 7, 2017, 8:05pm UTC](https://forum.ansible.com/t/struggling-with-ansible-gce-inventory/23668/2 "2017-02-07T20:05:02Z")

</div>

I’m using ansible 2.2.1.0
