Struggling with Ansible GCE inventory

51 views
Skip to first unread message

Tzach Livyatan

unread,
Feb 7, 2017, 10:44:08 AM2/7/17
to Ansible Project
I'm following the instructions at 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 <module>
    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

Tzach Livyatan

unread,
Feb 7, 2017, 3:05:02 PM2/7/17
to Ansible Project
I'm using ansible 2.2.1.0
Reply all
Reply to author
Forward
0 new messages