You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
plugin: gcp_computezones: # populate inventory with instances in these regions
- us-central1-aprojects:
- vpn-server-sasp#filters:#- machineType = n1-standard-1#- scheduling.automaticRestart = true AND machineType = n1-standard-1service_account_file: /home/cheo/sergio/ansible-gce/vpn-server-sasp-d5e0d0f06446.jsonauth_kind: serviceaccountscopes:
- 'https://www.googleapis.com/auth/cloud-platform'
- 'https://www.googleapis.com/auth/compute.readonly'keyed_groups:
# Create groups from GCE labels
- prefix: gcpkey: labelshostnames:
# List host by name instead of the default public ip
- namecompose:
# Set an inventory parameter to use the Public IP address to connect to the host# For Private ip use "networkInterfaces[0].networkIP"ansible_host: networkInterfaces[0].accessConfigs[0].natIP
EXPECTED RESULTS
A list of GCE instances
ACTUAL RESULTS
ansible-inventory 2.9.14
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/home/cheo/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible-inventory
python version = 2.7.17 (default, Jul 20 2020, 15:37:01) [GCC 7.5.0]
Using /etc/ansible/ansible.cfg as config file
host_list declined parsing /home/cheo/sergio/ansible-gce/inventory-gcp_compute.yml as it did not pass its verify_file() method
virtualbox declined parsing /home/cheo/sergio/ansible-gce/inventory-gcp_compute.yml as it did not pass its verify_file() method
[WARNING]: * Failed to parse /home/cheo/sergio/ansible-gce/inventory-gcp_compute.yml with yaml plugin: Plugin configuration YAML file, not YAML inventory
File "/usr/lib/python2.7/dist-packages/ansible/inventory/manager.py", line 280, in parse_source
plugin.parse(self._inventory, self._loader, source, cache=cache)
File "/usr/lib/python2.7/dist-packages/ansible/plugins/inventory/yaml.py", line 112, in parse
raise AnsibleParserError('Plugin configuration YAML file, not YAML inventory')
[WARNING]: * Failed to parse /home/cheo/sergio/ansible-gce/inventory-gcp_compute.yml with constructed plugin: Incorrect plugin name in file: gcp_compute
File "/usr/lib/python2.7/dist-packages/ansible/inventory/manager.py", line 280, in parse_source
plugin.parse(self._inventory, self._loader, source, cache=cache)
File "/usr/lib/python2.7/dist-packages/ansible/plugins/inventory/constructed.py", line 109, in parse
self._read_config_data(path)
File "/usr/lib/python2.7/dist-packages/ansible/plugins/inventory/__init__.py", line 224, in _read_config_data
raise AnsibleParserError("Incorrect plugin name in file: %s" % config.get('plugin', 'none found'))
[WARNING]: Unable to parse /home/cheo/sergio/ansible-gce/inventory-gcp_compute.yml as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
The text was updated successfully, but these errors were encountered:
SUMMARY
When trying to generate a Google Cloud Engine inventory via Inventory Plugin, I get multiple errors
ISSUE TYPE
COMPONENT NAME
Inventory Plugin
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Ubuntu 18.04.5 LTS
Linux 4.15.0-118-generic #119-Ubuntu SMP x86_64
STEPS TO REPRODUCE
ansible-inventory -i inventory-gcp_compute.yml --graph
EXPECTED RESULTS
A list of GCE instances
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: