New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gcp_compute plugin does not work #44404
Comments
Files identified in the description: If these files are inaccurate, please update the |
I hit this same error, but got it working via the following steps:
see: https://docs.ansible.com/ansible/2.5/plugins/inventory.html for more details
Also ensure your service account has enough permissions to access the desired resources. This is on ansible 2.6.3 with python 2.7.10. |
Also explicit specifing the enable_plugins sort order does not do the trick
|
still an issue with 2.6.4 |
still an issue with 2.7.0 |
Issue #45105 is a duplicate of this issue. I have also tested with 2.7.1, and the issue persists. |
I am also having this problem. Adding the |
Quick update. For me the issue turned out to be I was trying to use a variable inside the dynamic inventory file. This did not work because it was causing an "internal" Ansible error, not exposed even if
And this wasn't working either, for the same reason:
@bcoca @bhundven Is it expected that Ansible does not compile/expand/parse variables defined in the GCP dynamic inventory and/or "built-in" variables? |
So in your
This fixed this plugin for me. |
also does not work for me:
|
The example config on the ansible page is misleading or incorrect. Remove "google.com:" just need the project identifier
|
@chad-autry this finally did the trick documentation update should do the trick |
* Update example about dynamic inventory * minor typo fixes in gcp_utils * Additional information about enabling inventory plugin in ansible.cfg partially fixes: ansible#44404 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
@jesusch @chad-autry Can you confirm if #50183 works for you ? Thanks. needs_info |
@Akasurde works for me :) |
Such conflicting documentation; projects:
- google.com:graphite-playground I got it to work with the following (notice no plugin: gcp_compute
projects:
- my-gcp-project-id
filters:
scopes:
- https://www.googleapis.com/auth/compute
service_account_file: /path/to/ansible-inventory-plugin-service-account.json
auth_kind: serviceaccount This was based off other replies I saw on issue related to this, and the docs here which has it properly labelled. |
* gcp: documentation update * Update example about dynamic inventory * minor typo fixes in gcp_utils * Additional information about enabling inventory plugin in ansible.cfg partially fixes: ansible#44404 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* gcp: documentation update * Update example about dynamic inventory * minor typo fixes in gcp_utils * Additional information about enabling inventory plugin in ansible.cfg partially fixes: ansible#44404 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
also another gotcha: the file must have a suffix gcp.yml |
@jeremyarr This is already mentioned in documentation - https://docs.ansible.com/ansible/latest/plugins/inventory/gcp_compute.html#synopsis |
SUMMARY
gcp_compute plugin does not work. always an error that no matching inventory plugin is working
ISSUE TYPE
COMPONENT NAME
gcp_compute
ANSIBLE VERSION
CONFIGURATION
DEFAULT_HOST_LIST(/Users/jesusch/.ansible.cfg) = [u'/Users/jesusch/ansible/inventory']
DEFAULT_ROLES_PATH(/Users/jesusch/.ansible.cfg) = [u'/Users/jesusch/ansible/roles']
HOST_KEY_CHECKING(/Users/jesusch/.ansible.cfg) = False
RETRY_FILES_ENABLED(/Users/jesusch/.ansible.cfg) = False
OS / ENVIRONMENT
Darwin Bjorns-MacBook-Pro.local 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64
STEPS TO REPRODUCE
Configured GCP plugin as described in https://docs.ansible.com/ansible/2.6/scenario_guides/guide_gce.html
EXPECTED RESULTS
ansible-inventory --list -i inventory/myproject.gcp.yml should list my GC hosts and its metadata
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: