8000 gcp_compute incorrectly prints data to screen, breaking JSON output for ansible-inventory · Issue #59101 · ansible/ansible · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
gcp_compute incorrectly prints data to screen, breaking JSON output for ansible-inventory #59101
Closed
@kdelee

Description

@kdelee
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
  1. Create gcp_comput.yml and creds.json to access your gcp account
  2. Create python36 venv
  3. install anisble@stable-2.8
  4. run ansible-inventory -i gcp_compute.yml --list > ouput.28
  5. Inspect the output, see that it is valid JSON.
  6. install ansible@devel
  7. run ansible-inventory -i gcp_compute.yml --list > ouput.devel
  8. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects_2.9This issue/PR affects Ansible v2.9bugThis issue/PR relates to a bug.python3support:communityThis issue/PR relates to code supported by the Ansible community.tower_blockerIssues/pending fixes that are failing Tower integration tests or should otherwise block a release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0