So I plan to use a static and a dynamic inventory (gce) and this is what my 
play folder looks like:

.
├── ansible.cfg
├── credentials.json
├── gce_vars
│   ├── auth
│   └── test_servers
├── group_vars
│   └── all
├── hosts.yml
├── inventory
│   ├── gce.ini
│   ├── gce.py
│   └── hosts.yml
└── provision.yml

3 directories, 10 files


credentials.json is the json private key for my service account.

[root@workstation gcloud]# cat gce_vars/auth
---
service_account_email: "xxxxx-comp...@developer.gserviceaccount.com"
path_to_credentials: /workspace/gcloud/credentials.json
project_id: "heroic-XXX-XXX"
...

gce.ini

[gce]
libcloud_secrets =
gce_service_account_email_address = XXXXX-compute@developer.gserviceaccount.
com
gce_service_account_pem_file_path = /workstation/gcloud/credentials.json
gce_project_id = heroic-XXX-XXX

[inventory]
inventory_ip_type = external

[cache]
cache_path = ~/.ansible/tmp
cache_max_age = 300

However, when I try to run the dynamic inventory, I get this error:

[root@workstation inventory]# ./gce.py --list
Traceback (most recent call last):
  File "./gce.py", line 508, in <module>
    GceInventory()
  File "./gce.py", line 170, in __init__
    self.driver = self.get_gce_driver()
  File "./gce.py", line 318, in get_gce_driver
    gce = get_driver(Provider.GCE)(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/libcloud/compute/drivers/gce.py", 
line 1795, in __init__
    super(GCENodeDriver, self).__init__(user_id, key, **kwargs)
  File "/usr/lib/python2.7/site-packages/libcloud/common/base.py", line 
975, in __init__
    self.connection = self.connectionCls(*args, **conn_kwargs)
  File "/usr/lib/python2.7/site-packages/libcloud/compute/drivers/gce.py", 
line 99, in __init__
    credential_file=credential_file, **kwargs)
  File "/usr/lib/python2.7/site-packages/libcloud/common/google.py", line 
767, in __init__
    user_id, key, auth_type, credential_file, scopes, **kwargs)
  File "/usr/lib/python2.7/site-packages/libcloud/common/google.py", line 
653, in __init__
    self.user_id, self.key, self.scopes, **kwargs)
  File "/usr/lib/python2.7/site-packages/libcloud/common/google.py", line 
495, in __init__
    "file: '%s'" % key)
ValueError: Missing (or not readable) key file: 
'/workstation/gcloud/credentials.json'


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2c046b46-4dc0-46d3-bbd4-b999b27db76d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to