Closed
Description
SUMMARY
ansible-inventory
is supposed to return JSON...
but it does not when installing anisble@devel, and running a GCE inventory update with this gcp_compute.yml
to use the gcp inventory plugin:
auth_kind: serviceaccount
filters: null
plugin: gcp_compute
projects:
- myproject
service_account_file: creds.json
ISSUE TYPE
- Bug Report
COMPONENT NAME
gcp inventory plugin
ANSIBLE VERSION
ansible-inventory --version
ansible-inventory 2.9.0.dev0
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/elijah/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/elijah/venvs/py36towerqa/lib64/python3.6/site-packages/ansible
executable location = /home/elijah/venvs/py36towerqa/bin/ansible-inventory
python version = 3.6.8 (default, Feb 19 2019, 21:10:40) [GCC 9.0.1 20190209 (Red Hat 9.0.1-0.4)]
CONFIGURATION
#no output
OS / ENVIRONMENT
STEPS TO REPRODUCE
- Create gcp_comput.yml and creds.json to access your gcp account
- Create python36 venv
- install anisble@stable-2.8
- run
ansible-inventory -i gcp_compute.yml --list > ouput.28
- Inspect the output, see that it is valid JSON.
- install ansible@devel
- run
ansible-inventory -i gcp_compute.yml --list > ouput.devel
- Inspect output, see that before the part that starts the JSON that looks like:
{
"_meta": {
"hostvars": {
there is a bug chunk of key/value pairs in a list:
[{'key': 'blahkey', 'value': 'blahvalue}, {'key': 'ssh-keys', 'value': 'somebody's key'} {'key': 'more keys', 'value': 'more values' ...... ]
EXPECTED RESULTS
JSON
ACTUAL RESULTS
List of key/value pairs then regular json ouput
This is a tower blocker for the next release of ansible.
(private repo) https://github.com/ansible/tower/issues/3605